Jump to content
Server Maintenance This Week. ×

Multi-Page layouts


Baylah

This topic is 6284 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6284 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.