Baylah Posted February 10, 2007 Posted February 10, 2007 Hi Everyone, I have strruggled with this for years but now I am trying to take my FileMaker Skills to a different layer and I have to avoid being embarssed and just ask the question! Is there as technique that I can use to produce what I can only call multi-page documents that are created dynamically? My example is this....I also use QuickBooks at work. In QuickBooks when I am filling out an invoice that invoice can be as many lines as I want it to be and I will just get XX number of pages to the invoice when I go to print it. At no point does the program ever tell me that I ahve entered too much inforamtion to fit on one page (I.E. layout). I have developed work around soultions for this in FileMaker for unlimited pages but each of my solutions involves "clicking a button" when a page is "filled up." While this works, it is I think very clunky and unprofessioanl. There has to be a better way. My guess is that is through portals, but I still haven't been able to figure it out. Does anyone have any suggestions or be willing to share a solution with me that I could learn from. I would be very much appreciative. Thank you, Steve
Ender Posted February 10, 2007 Posted February 10, 2007 A portal (with the scroll bar on) will give you unlimited line items. But don't try to print from the same layout as this data-entry portal. For printing, use a list view layout based on the line item's table. This will give you as many pages as needed for the items to print. The print script for this would look something like: If [ line_items::recordID ] Go to Related Records [ Show only related records; table: line_items ; layout: Print Invoice (line_items) ] Sort Records [ no dialog; by RecordID ] Print [ restore; no dialog ] Go to Layout [ original layout ] End If
jamesducker Posted February 10, 2007 Posted February 10, 2007 Steve Ender is right, strictly speaking it is better to print from the line items file rather than the invoice 'header' file. That can be a bit unweildy though, especially when it comes to totalling up the columns of figures and putting headers and footers in, so I prefer to avoid it. What I sometimes do for invoice printing is create a layout for printing on one page only, and call it 'print invoice 1 page'. This will have, say, 20 portal rows on, and is fine for printing invoices with 20 lines or fewer. I then duplicate that layout and rearrange it for two pages. So instead of the totals at the bottom put "continued overleaf" and then on a second page put ANOTHER PORTAL but in the portal definition specify that I want it to show rows 21-50. (FM7 and above only.) You then have a layout suitable for use with 20 or fewer lines, and a layout suitable for use with 21-50 lines. The trick is to make your 'print invoice' script choose the correct layout at the time of printing. You can 'count' the portal rows by using the COUNT function on any field that you know will be in the line items file. (The field you count doesn't have to be shown in the portal, by the way. I always count the match field that links the portal to the header, because I know it will always be filled in - if it wasn't filled in, the record wouldn't be in the portal!) So your print script might be: If [ count(line items::invoice number) go to layout "print invoice 1 page" else if [ count(line items::invoice number) go to layout "print invoice 2 pages" else display dialog "Invoices cannot contain more than fifty lines. Please split the invoice in to two before printing." end if print You could of course make layouts for 3 pages, 4 pages, 5 pages etc... but it's not normal (depending on the business, I suppose) for an invoice to go on that long, so I usually just do 1 and 2. Always worth putting in an error trap just in case it does, though. James
Baylah Posted February 11, 2007 Author Posted February 11, 2007 Thanks for these tips! I will try them on a test solution tonight and if I can figure it out I am going to re-write a major portion of a new project. Thank you, Steve
comment Posted February 11, 2007 Posted February 11, 2007 As a user, I would not be happy with a solution telling me I need to split my invoice. As a developer, I am not aware of any problems with 'totalling up the columns of figures and putting headers and footers in'.
Recommended Posts
This topic is 6496 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now