Jump to content
Server Maintenance This Week. ×

Container Fields Printing Problem


michael25

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

Recommended Posts

Having a problem with printing multiple pages when some container fields are set to slide up when fields above are hidden.  I have a layout for one to enter expense info along with a copy of a receipt (jpg image).  Hard to describe but here's my attempt:

I have a 10 page layout with each page consisting of a first row with fields to enter data about, i.e., Reference Number, Date, Location, Reason.  Immediately below that row of data is a container field large enough to fill the entire page.  That container field is used to display a copy of a receipt (usually from the camera on the iPad using FM Go).  If all 10 pages are filled, or even if only the first 5, then the printout of those pages is perfect.

The problem comes up if there is a blank page somewhere after the first page.  Each page is set to be hidden if the Date field does not have data input (IsEmpty).  That function also works just fine.  All of the pages (after the first) are set to "slide up" if the fields above are hidden.  When printing, the "slide up" function works, sorta.  However, when the pages slide up they do not slide up to the top of the page.  If there is data in the date field (meaning the page is not hidden), then the first line of the page prints at the top with the correctly sized container field filling out the rest of the page.  If the fields on the next page are hidden, then the following page will only slide up to the point where the first line is displayed about 3 inches below the proper top position (which means the following container field is cut off to display on two separate pages).  All pages after that also have the data/container field lines moved down.

What am I missing here??

Link to comment
Share on other sites

Hi Michael,

You have just been enlighten that printing containers like this in FileMaker can be very flakey.

Maybe it best to generate a PDF to be printed. Check out this example file I attached.

Another route, which would require re-working you data architecture, is to have your expense documents in it's own table. If you were creating related records, there would be no gaps when you went to print the expense items.

Hope this helps!!!

slideprint.zip

Link to comment
Share on other sites

Thanks.  A PDF is the primary output for this layout.  I just created a record (20 pages) with no hidden fields (to slide up) and on the screen display everything looks perfect.  Spacing of the top row of data and the bottom row is exact.  But, when I print it to a PDF the first 6 pages print normal, but then page 7 gets some weird spacing at the top, which in turn causes all the pages below that to be out of sync.

Link to comment
Share on other sites

I don't understand your initial description too well. It sounds like you have 10 identical sets of fields in a single record, with each set forming a page in your report. If that's correct, you'd be well advised to change your structure and create a separate record in a related table for each "page'. A lot of things will become easier, not just the one you're currently struggling with.

Link to comment
Share on other sites

Thanks, comment.  The "hide/slideup" method is just way too complex and overkill.  Dwdata "enlightened" me so I'm creating separate layouts for each container field and then create a scrip to create/append to a pdf for the final output.

 

Link to comment
Share on other sites

That doesn't sound like "enlightenment" to me.

Well, it "enlightened" me enough to know I don't want to do that "hide and slide" thing anymore.

New question:  In the process of creating the script which creates the pdf file.  It is working fine and doing exactly what I needed it to do.  Slight problem is when the script starts, the first section creates the initial page for the PDF.  The next 10 sections create a pdf page to append to the first page (eventually it will be 20 sections to create up to a 21 page pdf).  The first function brings up a window to allow me to define the name of the pdf file I want to create.  As soon as I do that and when the second and subsequent functions each bring up a window where I have to select "append".  After doing all that I have a file like I want.

What is the process to use to have the script not as me to click on "append"?  In other words, I want to name the file (which it allows) and as soon as I do that I want the script to finish the entire "append" process with no further action from me.

Edited by michael25
Link to comment
Share on other sites

Shrug.

Not sure what "Shrug" means.

I'm pretty sure I followed your recommendation about splitting up the data.  I'll attempt to explain more clearly what's going on.

On a single layout, there are five "tasks" which incur expenses.  Each of these tasks has a line of fields where expense info is entered.  Below that line is a row of four small container fields to insert a copy of the receipt related to the expense (the receipt copy is made with the iPad camera). This is repeated for a total of five tasks consisting of up to four receipts each, meaning up to a total of 20 receipts on that layout (although exceeding 7-8 total receipts would be rare).

Now, using the info from that layout I created 20 layouts, each consisting of  6 fields (job number, date, vendor, category, $ amount and the container field for the receipt).  The fields on that layout are automatically populated from the info entered on the main data entry layout.  These 20 layouts are the "page" which will be converted to a pdf.

The script to generate the "report" looks at the "date" field in the first layout and if it contains a date then a page is generated.  If the date field "isEmpty" then the script goes to the next layout and repeats the process.  So, with 20 layouts available, the script might find 5 of them with data so it creates a 5 page pdf (ignoring any blank layouts).

I hope that's a better explanation of what I am doing.  Initially, this process seems to work very well and I really appreciate your advice to go that route. 

Link to comment
Share on other sites

Michael,

In my example file, I only had one layout with with global fields. Plus, the scripting logic to SKIP and to CREATE or APPEND to a PDF.

Are those 20 layout the same design format? If so, only one template layout (with globals) is necessary. You simply populate the GLOBALS as needed and  then create or append to PDF.

Virtual head scratching going on here ;o)
 

Link to comment
Share on other sites

Michael,

In my example file, I only had one layout with with global fields. Plus, the scripting logic to SKIP and to CREATE or APPEND to a PDF.

Are those 20 layout the same design format? If so, only one template layout (with globals) is necessary. You simply populate the GLOBALS as needed and  then create or append to PDF.

Virtual head scratching going on here ;o)
 

Yes, all 20 layouts are exact duplicates of each other.  When filling out a layout elsewhere in the program, the proper layout is populated with the data.  That means for a particular record, those layouts may only have four or five (pick any group of numbers from 1-20) with any data in them.  The rest are blank.  The pdf creation script looks at each layout in order and if it doesn't see data in one or more of those layouts then it doesn't "print/append" to the PDF.  It is working great right now...except for it bringing up a window where I have to mouse-click on the "append" button every time it finds a layout with data.

Edited by michael25
Link to comment
Share on other sites

Not sure what "Shrug" means.

It means I have suggested an easy way but if you insist on doing this the hard way, I will not try and convince you. If you want your report to have a page for each expense (here: an actual expense, with an image of a receipt), then it should be produced from a table of Expenses, where each (real) expense is an individual record. This would require only one layout and the entire PDF would be produced at once without any appending.

Judging from your description, you should actually have three tables: Jobs, Tasks and Expenses, related as 'one job has many tasks' and 'one task has many expenses'.

Edited by comment
  • Like 1
Link to comment
Share on other sites

Oh seriously, they should be records.  All issues regarding your needs here will disappear and your life will be far simpler.   Any time you see multiple 'like' things as fields - stop yourself.  It means they should be records.  

Link to comment
Share on other sites

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