Constant Row Count On Form Layout

Notes on the new SeedCode Complete template for FileMaker 13
Posts: 72
Joined: Mon Feb 04, 2013 11:54 am
PostPosted: Tue Nov 21, 2017 6:37 pm
This is not necessarily a Seedcode question but I'll ask the forum community anyway.

Does anyone know of a solution to automatically fill a form layout with empty rows to fill the form in the event that there are not enough records to fill the form?

I have a form that needs exactly 12 rows of client data on each page. Often the last page does not have enough records to fill the page. Is there a way to ensure that a page will fill with blank records as needed to fill the page?

Thanks
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Wed Nov 29, 2017 10:34 am
Is this about getting something to print properly? Not sure I understand the issue =)

Thanks,

John
John Sindelar
SeedCode
Posts: 72
Joined: Mon Feb 04, 2013 11:54 am
PostPosted: Sat Dec 09, 2017 12:44 pm
Sorry for the delayed response John.

I have a script that creates a form that generates a PDF file. The form has static layout items with database fields that are filled in for each client. The form is designed to handle 12 rows of information on each page. This works fine as long as there are 12 client records for each page. On the last page when there is less than 12 records I would like to pad the remaining rows with blank data so that the form still prints 12 rows.

In other words a static form with 12 blank rows and records fill in the data as needed.

I hope this makes sense.

Thanks.
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Sun Dec 10, 2017 8:07 am
Thanks for the details, Ken. FileMaker is not great at this kind of thing--at filling in gaps. If you print a summary report of sales for the year, for example, and you have no sales in November., FileMaker won't know to create an empty summary row for "Love,ber". It doesn't know to do this when making charts either.

So I see two strategies for making getting your additional rows drawn:

1. Sounds like the row is the body element of your report and you're printing a found set. It doesn't need to be that way: your report could be just a full page layout and the "rows" would be calculated fields that show information from the correct "row" record. This way your black rows would always be there, drawn on the layout and *some* of them would have record data in them. The trick with this approach is knowing how many pages to print based on your found set of rows, and it probably gets more complicated if the first page of your report different from subsequent pages.

2. You could keep the approach where you print a found set, but have a script create new blank records in that found set to make sure the found count is always a multiple of 12. So if you have 8 records in your found set when you begin printing, your script would create 4 more. If you had 21 records, you script would create 3 more. The issue here is that you'll have orphan records in your table if you don't delete them after printing and your users may not have delete delete privileges in this table. AND you don't want to just delete any black records as you could delete those being used in another users print job. Some developers get past this by importing the records they want to print into a temp table where creating new blank records is less problematic.

In any event, probably a lot of scripting in your future. It's had to give really specific advice about stuff like this but I hope the general approaches described above are helpful. If you'd like more help, we can script either approach for you, or teach you how to do it, as part of an implementation package.

- John
John Sindelar
SeedCode
Posts: 72
Joined: Mon Feb 04, 2013 11:54 am
PostPosted: Fri Dec 22, 2017 8:58 am
Thanks John.

Great information and detail. I thought this would eventually lead to an implementation package. Better to burnout Dan's brain cells than mine. His works better too. :lol:

Happy Holidays! to you, your family, and your staff.

Ken
SeedCode Staff
SeedCode Staff
Posts: 2764
Joined: Thu Nov 20, 2003 11:01 am
PostPosted: Fri Dec 22, 2017 10:20 am
HA! Thanks, Ken.

Have a wonderful New Year!

- John
John Sindelar
SeedCode

Return to SeedCode Complete 13

Who is online

Users browsing this forum: No registered users and 1 guest

cron
(855) SEEDCODE
[email protected]
Follow us: