Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted (edited)

I'm trying to work around filemaker's 12-page per record limit by having a separate report for overflows. I have a seperate input field with instructions to continue into the overflow input field if the input is past a certain length. This goes into a separate report layout that just has the standard header/footer, and this text field for the overflow.

I'm setting up a script to print from the main report, then print the overflow report, by record so it prints out properly.

Here's the problem: Even if the overflow field is blank (meaning the input data was less than the 12 page limit), I get a page for the overflow, which is blank + headers/footers. I don't want it to have a page there if there's no content. Is there a way to fix this? Two approaches would be to either make it so the page never is generated in preview mode in the first place, or scripting it so that "if page = blank, skip printing"

Removing blank pages from a report itself isn't more than annoying, but I'm also trying to set up a page number script that resets on each record. Blank pages that get tossed would ruin this because they'd get a number.

If it helps, here's my print script. (doens't include the page number bit yet)

Enter Browse Mode []

Got to Record/Request/Page [First]

Loop

Enter Preview Mode []

Go to Layout ["Report" (Main table2)]

Print [Restore]

Go to Layout ["Overflow" (Main table2)]

Print [Restore]

Enter Browse Mode []

Go to Record/Request/Page [Next]

End Loop

Edited by Guest
Posted

You can use If[] branching to decide whether or not to print each subsequent page. Something like:

...

Loop

Go to Layout ["Report" (Main table2)]

Print [Restore]

If [ not isempty(Main table2::overflow) ]

Go to Layout ["Overflow" (Main table2)]

Print [Restore]

End If

Go to Record/Request/Page [Next]

End Loop

Posted (edited)

Thank you very much, that was exactly what I'm looking for!

One more thing: I have a question about how the print[] function knows what to print. I can set the settings to make it print the current record, which is what I had set up before, but I made the script with page numbers, which inherently changes what print does: It needs to print the current page. (which I think I'm setting by going into preview mode and doing next record/request/page) The options in specify for print[] don't have "this page".

Will the print function in this script make work correctly, that is printing only the current page and no printing out the whole record/set each time? I want to test without printing out 50 pages.

Enter Browse Mode

Go to Record/Request/Page[ First ]

Loop

Set Variable [ $page; Value:0 ]

Loop

Enter Preview Mode

Go to Layout [ “Report” (Main table2) ]

Set Variable [ $page; Value:$page+1 ]

Set Field [ Main table2::Page Number; $page ]

Print [ ][ No dialog ]

Go to Record/Request/Page[ Next ]

End Loop

If [ not IsEmpty(Main table2::SA overflow) ]

Loop

Enter Preview Mode

Go to Layout [ “Overflow” (Main table2) ]

Set Variable [ $page; Value:$page+1 ]

Set Field [ Main table2::Page Number; $page ]

Print [ ][ No dialog ]

Go to Record/Request/Page[ Next ]

End Loop

End If

Enter Browse Mode

Go to Record/Request/Page[ Next ]

End Loop

Edited by Guest
Posted

Hey Dave,

If there's only one page per layout per record, you should be able to print your pages without switching to Preview Mode.

If some layouts could have multiple pages, you'd go into Preview Mode for the sole purpose of jumping to the last page for that record so you could get the page count and increment the starting Page Number for the subsequent print.

This is fairly easy if the found set only has one record (just Go to Record/Request/Page [ Last ]). But if there are multiple records in the found set, you'd have to loop through each page until the RecordID matches what the current record was (that's the Starting Page Number).

For printing the page number, use a global to to store the Starting Page Number, and an unstored calc = Starting Page Number + get(PageNumber) - 1. Place the unstored calc on the print layouts.

Posted

Thanks! You just cleared up my issue. The way I was trying to do it isn't going to work because Filemaker won't prince single pages, but that way sounds great, and I didn't understand it before but now I think I do. The ## command isn't the total page number, but the page number per print job (in this case, record)

I'm making progress, but have a problem: The per-record page numbers are working right on my main layout, and I'm working logic to get them to show up right on my overflow layout. However, the cumulative page numbers are not showing up right due to a syntax problem.

Here's what I typed <<## + $pagecount>>

What I see is the page number, then literally " + $pagecount" instead of adding the page number to the page count. (Page count is a variable calculated using the page count per record summed using the loop) How can I get it to actually calculated the page number on the fly? From what you've told me, you'd have to do this in the field itself since it's not possible to print page-by-page.

Posted

Merge fields can't evaluate in-line calcs, so you'd need a calc to do the page number. Then put the calc on your form. This is what I said:

For printing the page number, use a global to to store the Starting Page Number, and an unstored calc = Starting Page Number + get(PageNumber) - 1. Place the unstored calc on the print layouts.

A variable could take the place of the "global field", but the variable may need to be of the $$ variety.

Posted

You can not put a variable directly on a layout like that. Please see the links that i posted in your other thread regarding page count.

Posted

...in your other thread regarding page count.

What? Are you two-timing me, Dave? Say it ain't so! And I thought we really had something here... :P

Posted (edited)

What? Are you two-timing me, Dave? Say it ain't so! And I thought we really had something here... :P

Haha, this thread was originally about overflow layouts, and I thought that it had died, so I made a new one in the print forum about page numbers. :

I'm still trying to figure this out. I was using a merge field because I didn't know what a calc field was. (looking that up atm)

edit: Have a question about calc fields: I can't get it to show up properly, even with a simple test example.

Here's what I'm doing:

-ctrl+shift+d to bring up fields

-create a field called "testing"

-go to options, check calculated value

-set it to "5+1"

-make the field type "number"

-Add in a merge field <> textbox or just a field in layout linked to "testing"

I'm getting blank. What did I do wrong? (is this not what you meant by calc?)

Edited by Guest
Posted (edited)

Is it possible to have the page number modified by a variable? In this case, for per-record page numbers? This is so the overflow layout's per-record page numbers show correctly. The variable in this case would be the the number of pages of the record in the main report.

Let's say there are 3 main report pages and 3 overflow pages for the example (even though main pages would always be 12 if there's an overflow)

Current:

Page 1

Page 2

Page 3

Page 1

Page 2

Page 3

What it should be

Page 1

Page 2

Page 3

Page 1 + 3

Page 2 + 3

Page 3 + 3

The sums are how it would calculate the page numbers, it should actually print the correct numbers. The 3 added to them is found using a script that counts the number of pages in the main report part of the record, how mr. vodka described.

This is not a logic issue, it's a how-do-you-do-it-in-filemaker issue that should be pretty easy, but I can't find it. Is it possible to properly set the overflow per-record page numbers like this? I've tried using a merge field <<## + $pagecount>>", which doens't work. I've tried creating a field that autocalculates based on "$pagecount + get(PageNumber)" Neither work. Any ideas?

Edited by Guest
Posted

Don't use an auto-enter calc, use a Calculation field (with the storage option set to "Do not store").

Posted

Don't use an auto-enter calc, use a Calculation field (with the storage option set to "Do not store").

Thanks, that did it! I didn't realize that calculation was a separate field type. (Not sure what the point of number is then, since number is traditionally what databases use for numbers that need to have calculations performed on.)

I really appreciate the help, I think I've got this straightened out now, except for some logic issues causing some numbers to skip between records and the overflow section, but it basically works now. :P

Posted (edited)

Is there something else besides the "show related records" command in mr. vodka's example script that's needed to find the last page of teh record? I'm asking because it turns out my logic problem wasn't really a logic problem - it's going to and storing the last page of the entire recordset in the layout instead of just the last page of the record.

I modified my script to resemble the example script as much as possible, but it's still searching through the end of my recordset instead of the current record when finding the $$reportpages and $$overflowpages variables. It's like going into preview mode with all records showing and using the last page of that, as opposed to with all records but the current one ommitted.

Is there a way to omit all records but the current one? That should do the trick.

Here's what it looks like currently. (page number on overflow sheets is the pagenumber+$$recordpages, total page count is page number+$$pagecount.)

Go to Record/Request/Page[ First ]

Go to Layout [ “Report” (Main table2) ]

Show All Records

Set Variable [ $$pagecount; Value:0 ]

Loop

Set Variable [ $$reportpages; Value:0 ]

Set Variable [ $$overflowpages; Value:0 ]

Go to Related Record [ From table: “Main table2”; Using layout: ][ Show only related records ]

Enter Preview Mode

Go to Record/Request/Page[ Last ]

Set Variable [ $$reportpages; Value:Get(PageNumber) ]

Print [ ]

If [ not IsEmpty(Main table2::SA overflow) ]

Go to Layout [ “Overflow” (Main table2) ]

Go to Related Record [ From table: “Main table2”; Using layout: ][ Show only related records ]

Go to Record/Request/Page[ Last ]

Set Variable [ $$overflowpages; Value:Get(PageNumber) ]

Print [ ]

Go to Layout [ “Report” (Main table2) ]

End If

Set Variable [ $$pagecount; Value:$$pagecount + $$overflowpages + $$reportpages ]

Enter Browse Mode

Show All Records

Go to Record/Request/Page[ Next; Exit after last ]

End Loop

Edited by Guest
Posted

Ok I think that you may be overcomplicating this entire process. If you want to generate the number for just that current record that you are on in your found set, have a new window open when using Go to Related Record. The background window will still retain your orig found set.

So your script could be something such as:

Go to Related Record [ Show only related records; From table: “Main table2”; Using layout: ; New Window ]

Enter Preview Mode

Go to Record/Request/Page[ Last ]

Set Field [ gTotalPages; Value:Get(PageNumber) ]

Print []

Close Window [Name: "tempwindow"; Current File]

When performing the GTRR for the selfjoin, it will only display that one record.

Posted (edited)

Adding in the window part didn't seem to work. I don't think I'm overcomplicating it because I need per-record page numbers and overall page numbers. The per-record page numbers for non-overflow are just ## or Get(pagenumber), the per-record page numbers for overflow are Get(pagenumber) + $$recordpages, the total page numbers for non-overflow are $$pagecount + get(pagenumber), and overflowed total page numbers are $$pagecount + get(pagenumber) + $$recordpages.

I think I have a workaround, but need syntax advice. Is there a way to set a find to go to a specified record number? I added a $$recordnumber variable that counts the current record, so I can use that to find only the current record, but I don't know the syntax.

In other words, what's the correct syntax for the following?

find records where recordnumber = $$recordnumber

Hopefully this should solve the problem, thanks.

edit: nvm, this won't work because ommissions you make in find mode won't carry over to preview mode which you need to find the last page. I must be missing something painfully obvious here because the complicated parts of my script dealing with merging etc are fine, it's that i can't get it to go to the last page of the current record.

Edited by Guest

This topic is 6366 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.