Main Page | Report this Page
Computers Forum Index  »  Computer - Databases - Filemaker  »  Printing Multiple Layouts (Pages) to One Report...
Page 1 of 1    

Printing Multiple Layouts (Pages) to One Report...

Author Message
senriz...
Posted: Wed Oct 14, 2009 1:42 pm
Guest
I'm a Novice, so here goes... I have a db that has a TO with Names and
a TO with Forms. All the Forms are on One layout using Tabs, which
each Tab Name corresponding to the Form Number. I also have created a
Printable Layout that correspondes to each Tab, hence Tab Name Form1,
Layout Name Form 1. I also have a number field on each layout named
Print1, Print2, ect. that is associated with a Valuelist Checkbox that
has only One value: 1, but on the layout it only shows the checkbox.
This checkbox is checked if the Form is to be printed with other
selected forms into One Report. With that said Form 1, Form 7 and
Form 48 might need to be printed in a single report that will be
number Page __ of __.

I've been trying to write a script that basically would say If Print1
= 1, then go to layout Form 1 and save as PDF and then, go to Print2
and if Print2 = 1, go to layout Form 2 and append to PDF, and so
on... BUT if Print1 = 0, then go to Print2 and if Print2 = 1, go to
layout Form 2 and save as PDF or if Print2 = 0, then go to Print3.
And so on, and so on. THIS IS NOT WORKING FOR ME!!!

I need this script to go through all the forms to see if the field is
checked and if it is, then all those that are checked need to print to
the PDF, with the "Page __ of __."

Can anyone help me?
 
senriz...
Posted: Wed Oct 14, 2009 8:48 pm
Guest
On Oct 14, 1:12 pm, "Your Name" <your.n... at (no spam) isp.com> wrote:
Quote:
"senriz" <dbsen... at (no spam) gmail.com> wrote in message

news:32c57d8e-032c-499a-82f7-f659a567747d at (no spam) a39g2000pre.googlegroups.com...





I'm a Novice, so here goes... I have a db that has a TO with Names and
a TO with Forms.  All the Forms are on One layout using Tabs, which
each Tab Name corresponding to the Form Number.  I also have created a
Printable Layout that correspondes to each Tab, hence Tab Name Form1,
Layout Name Form 1.  I also have a number field on each layout named
Print1, Print2, ect. that is associated with a Valuelist Checkbox that
has only One value: 1, but on the layout it only shows the checkbox.
This checkbox is checked if the Form is to be printed with other
selected forms into One Report.  With that said Form 1, Form 7 and
Form 48 might need to be printed in a single report that will be
number Page __ of __.

I've been trying to write a script that basically would say If Print1
= 1, then go to layout Form 1 and save as PDF and then, go to Print2
and if Print2 = 1, go to layout Form 2 and append to PDF,  and so
on... BUT if Print1 = 0, then go to Print2 and if Print2 = 1, go to
layout Form 2 and save as PDF or if Print2 = 0, then go to Print3.
And so on, and so on.  THIS IS NOT WORKING FOR ME!!!

I need this script to go through all the forms to see if the field is
checked and if it is, then all those that are checked need to print to
the PDF, with the "Page __ of __."

Can anyone help me?

I'm not sure that you can appened to an existing PDF, but assuming newer
versions of FileMaker allow this, then the "printing" Script itself is
fairly easy ... you've already given the basic version above. All you need
is a set of separate If / End If statements.
i.e.
     If Print1 = 1
          Go To Layout [Form1]
          Page Setup [Restore; NoDialog]
          Print []
     End If
     If Print2 = 1
          Go To Layout [Form2]
          Page Setup [Restore; NoDialog]
          Print []
     End If
     If Print3 = 1
          Go To Layout [Form3]
          Page Setup [Restore; NoDialog]
          Print []
     End If
 {continue for all Forms required}

The bigger problem is the "Page X of Y". his is going to be impossible to do
thanks to FileMaker's Preview mode not being 100% accurate to what gets
printed / PDFed ... unless each Form is always a single page, then it is
possible using a "Counter" global field / variable.

Helpfull Harry  Surprised)- Hide quoted text -

- Show quoted text -

Thanks!! I'll try that and let you know how it goes.
 
Your Name...
Posted: Thu Oct 15, 2009 12:12 am
Guest
"senriz" <dbsenriz at (no spam) gmail.com> wrote in message
news:32c57d8e-032c-499a-82f7-f659a567747d at (no spam) a39g2000pre.googlegroups.com...
Quote:
I'm a Novice, so here goes... I have a db that has a TO with Names and
a TO with Forms. All the Forms are on One layout using Tabs, which
each Tab Name corresponding to the Form Number. I also have created a
Printable Layout that correspondes to each Tab, hence Tab Name Form1,
Layout Name Form 1. I also have a number field on each layout named
Print1, Print2, ect. that is associated with a Valuelist Checkbox that
has only One value: 1, but on the layout it only shows the checkbox.
This checkbox is checked if the Form is to be printed with other
selected forms into One Report. With that said Form 1, Form 7 and
Form 48 might need to be printed in a single report that will be
number Page __ of __.

I've been trying to write a script that basically would say If Print1
= 1, then go to layout Form 1 and save as PDF and then, go to Print2
and if Print2 = 1, go to layout Form 2 and append to PDF, and so
on... BUT if Print1 = 0, then go to Print2 and if Print2 = 1, go to
layout Form 2 and save as PDF or if Print2 = 0, then go to Print3.
And so on, and so on. THIS IS NOT WORKING FOR ME!!!

I need this script to go through all the forms to see if the field is
checked and if it is, then all those that are checked need to print to
the PDF, with the "Page __ of __."

Can anyone help me?

I'm not sure that you can appened to an existing PDF, but assuming newer
versions of FileMaker allow this, then the "printing" Script itself is
fairly easy ... you've already given the basic version above. All you need
is a set of separate If / End If statements.
i.e.
If Print1 = 1
Go To Layout [Form1]
Page Setup [Restore; NoDialog]
Print []
End If
If Print2 = 1
Go To Layout [Form2]
Page Setup [Restore; NoDialog]
Print []
End If
If Print3 = 1
Go To Layout [Form3]
Page Setup [Restore; NoDialog]
Print []
End If
{continue for all Forms required}


The bigger problem is the "Page X of Y". his is going to be impossible to do
thanks to FileMaker's Preview mode not being 100% accurate to what gets
printed / PDFed ... unless each Form is always a single page, then it is
possible using a "Counter" global field / variable.

Helpfull Harry Surprised)
 
Your Name...
Posted: Thu Oct 15, 2009 4:19 am
Guest
If the From layouts need different Page Setup options (e.g. one is lanscape,
one is portrait, one is A5, etc.), then in older versions of FileMaker you
will need to use separate sub-scripts to print each Form since a Script can
only store one Page Setup.

Helpfull Harry Surprised)
 
senriz...
Posted: Thu Oct 15, 2009 10:37 pm
Guest
On Oct 14, 5:19 pm, "Your Name" <your.n... at (no spam) isp.com> wrote:
Quote:
If the From layouts need different Page Setup options (e.g. one is lanscape,
one is portrait, one is A5, etc.), then in older versions of FileMaker you
will need to use separate sub-scripts to print each Form since a Script can
only store one Page Setup.

Helpfull Harry  Surprised)

Thanks. I will keep that in mind. I haven't gotten to the
"landscape" forms yet... just working on the first few which are all
portrait. I'm using FMP 9 Advance. Below is my script so far and
it's working perfectly. Your instructions were very helpful... I had
a nested if statement that was causing the problem. Can you advise me
on how I might add a TotalPageCount... like Page __ of "__"?

Go to Layout [ “IEPForms” (IEP) ]
Enter Preview Mode
Set Field [ Global::gPageNumber; 0 ]
Go to Layout [ “IEPForms” (IEP) ]
If [ ValueCount(IEP::Print1) > 0 ]
Go to Layout [ “Form 1” (IEP) ]
Enter Preview Mode
Go to Record/Request/Page [ Last ]
Set Field [ Global::gPageNumber; Global::gPageNumber + Get
(PageNumber) ]
Print [ Restore; No dialog ]
Go to Layout [ “IEPForms” (IEP) ]
End If
If [ ValueCount(IEP::Print2) > 0 ]
Go to Layout [ “Form 2” (IEP) ]
Enter Preview Mode
Go to Record/Request/Page [ Last ]
Set Field [ Global::gPageNumber; Global::gPageNumber + Get
(PageNumber) ]
Print [ Restore; No dialog ]
Go to Layout [ “IEPForms” (IEP) ]
End If
Enter Browse Mode
 
Your Name...
Posted: Fri Oct 16, 2009 5:31 am
Guest
"senriz" <dbsenriz at (no spam) gmail.com> wrote in message
news:a2e8796e-acd0-4593-b6bf-0e7b0e401ab0 at (no spam) m7g2000prd.googlegroups.com...
Quote:

Thanks. I will keep that in mind. I haven't gotten to the
"landscape" forms yet... just working on the first few which are all
portrait. I'm using FMP 9 Advance. Below is my script so far and
it's working perfectly. Your instructions were very helpful... I had
a nested if statement that was causing the problem. Can you advise me
on how I might add a TotalPageCount... like Page __ of "__"?

Snip a Script


There are three possibilities ...


VARIABLE LENGTH FORMS
If the number of pages for any Form can vary depending on the data (i.e.
Form 4 might sometimes be 2 pages, sometimes 3 pages), then it’s simply not
possible to know the total number of pages that will be printed due to
FileMaker’s inaccurate Preview Mode ... that means your Preview / Go To Last
Page Script won't always give the correct answer. Surprised(



SINGLE PAGE FORMS
If ALL the Forms are only one page long, then it’s very easy.

First you can calculate the total number of pages for the entire report by
simply adding up all the checkbox values (since they are either 1 or 0). It’
s probably easiest to calculate this value at the start of the Script and
store it in a Global Field or Variable.

The “current” page number for each Form can be set using a second Global
Field / Variable as the Script runs through, remembering to reset it to 0 at
the start of the Script.

Both Fields / Variables can be put in the Footer of each Layout. It’s
probably easiest to use Merge Fields.
e.g.
Page <<g_Current>> of <<g_Total>>

This means your printing / PDFing Script would be something like:

Set Field [g_Current; 0]
Set Field [g_Total; Form1 + Form2 + Form3 + ...]
If Form1 = 1
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout1]
Page Setup [Restore; No Dialog]
Print []
End If
If Form2 = 1
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout2]
Page Setup [Restore; No Dialog]
Print []
End If
If Form3 = 1
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout3]
Page Setup [Restore; No Dialog]
Print []
End If
... {continue for all necessary Forms}



MULTI-PAGE FORMS
If some / all of the Forms are multiple pages (but each is always the same
number), then it might be easier to not bother trying to number the pages,
but instead use the above method to number the Forms rather than pages in
the Footers.
i.e.
Form <<g_Current>> of <<g_Total>>

Trying to actually number the pages will get a bit messy – the easiest
approach is probably to split each Form’s pages into separate Layouts, and
then use the same method above. So if Form 2 is three pages long, then it
would become three separate Layouts and that section of your Script would
become:

If Form2 = 1
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout2_Page1]
Page Setup [Restore; No Dialog]
Print []
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout2_Page2]
Page Setup [Restore; No Dialog]
Print []
Set Field [g_Current; g_Current + 1]
Go To Layout [Layout2_Page3]
Page Setup [Restore; No Dialog]
Print []
End If

You would also need to modify the total pages calculation to multiply the
appropriate checkbox value by the number of pages for that Form.
e.g.
If ALL Forms have two pages, the calculation is:
Set Field [g_Total; Form1 * 2 + Form2 * 2 + Form3 * 2 + ...]
or more simply:
Set Field [g_Total; (Form1 + Form2 + Form3 + ...) * 2]

If the Forms have differing numbers of pages, the calculation is:
Set Field [g_Total; Form1 + Form2 * 3 + Form3 * 4 + ...]
when Form 1 has one page, Form 2 has three pages, and Form3 have 4
pages.



Helpful Harry Surprised)
 
senriz...
Posted: Sun Oct 18, 2009 2:38 am
Guest
On Oct 15, 10:16 pm, "Your Name" <your.n... at (no spam) isp.com> wrote:
Quote:
"senriz" <dbsen... at (no spam) gmail.com> wrote in message

news:a2e8796e-acd0-4593-b6bf-0e7b0e401ab0 at (no spam) m7g2000prd.googlegroups.com...

Thanks.  I will keep that in mind.  I haven't gotten to the
"landscape" forms yet... just working on the first few which are all
portrait.  I'm using FMP 9 Advance.  Below is my script so far and
it's working perfectly.  Your instructions were very helpful... I had
a nested if statement that was causing the problem.  Can you advise me
on how I might add a TotalPageCount... like Page __ of "__"?

Snip a Script

There are three possibilities ...

VARIABLE LENGTH FORMS
If the number of pages for any Form can vary depending on the data (i.e.
Form 4 might sometimes be 2 pages, sometimes 3 pages), then it’s simply not
possible to know the total number of pages that will be printed due to
FileMaker’s inaccurate Preview Mode ... that means your Preview / Go To Last
Page Script won't always give the correct answer.  Surprised(

SINGLE PAGE FORMS
If ALL the Forms are only one page long, then it’s very easy.

First you can calculate the total number of pages for the entire report by
simply adding up all the checkbox values (since they are either 1 or 0). It’
s probably easiest to calculate this value at the start of the Script and
store it in a Global Field or Variable.

The “current” page number for each Form can be set using a second Global
Field / Variable as the Script runs through, remembering to reset it to 0 at
the start of the Script.

Both Fields / Variables can be put in the Footer of each Layout. It’s
probably easiest to use Merge Fields.
e.g.
    Page <<g_Current>> of <<g_Total

This means your printing / PDFing Script would be something like:

    Set Field [g_Current; 0]
    Set Field [g_Total; Form1 + Form2 + Form3 + ...]
    If Form1 = 1
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout1]
       Page Setup [Restore; No Dialog]
       Print []
    End If
    If Form2 = 1
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout2]
       Page Setup [Restore; No Dialog]
       Print []
    End If
    If Form3 = 1
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout3]
       Page Setup [Restore; No Dialog]
       Print []
    End If
    ... {continue for all necessary Forms}

MULTI-PAGE FORMS
If some / all of the Forms are multiple pages (but each is always the same
number), then it might be easier to not bother trying to number the pages,
but instead use the above method to number the Forms rather than pages in
the Footers.
i.e.
    Form <<g_Current>> of <<g_Total

Trying to actually number the pages will get a bit messy – the easiest
approach is probably to split each Form’s pages into separate Layouts, and
then use the same method above. So if Form 2 is three pages long, then it
would become three separate Layouts and that section of your Script would
become:

    If Form2 = 1
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout2_Page1]
       Page Setup [Restore; No Dialog]
       Print []
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout2_Page2]
       Page Setup [Restore; No Dialog]
       Print []
       Set Field [g_Current; g_Current + 1]
       Go To Layout [Layout2_Page3]
       Page Setup [Restore; No Dialog]
       Print []
    End If

You would also need to modify the total pages calculation to multiply the
appropriate checkbox value by the number of pages for that Form.
e.g.
      If ALL Forms have two pages, the calculation is:
      Set Field [g_Total; Form1 * 2 + Form2 * 2 + Form3 * 2 + ...]
      or more simply:
      Set Field [g_Total; (Form1 + Form2 + Form3 + ...) * 2]

      If the Forms have differing numbers of pages, the calculation is:
      Set Field [g_Total; Form1 + Form2 * 3 + Form3 * 4 + ...]
      when Form 1 has one page, Form 2 has three pages, and Form3 have 4
pages.

Helpful Harry  Surprised)

Thank you so very much!! I got it to work beautifully. I actually
had put each page on a layout all by itself when a form had multiple
pages, so that ended up being a bit easier. Also, I got the Landscape
and Portrait print to work quite well. I add the Print Setup Function
above the Print Function enabling either Portrait or Landscape when a
Form's orientation changed. So if the first Five Forms were Portrait
I only needed to put that Function in the first one, then change it
for Form 6 to Landscape, and then only change it again when one of the
following Forms changed back to Portrait. Again, thank you. Your
instructions were extremely helpful.
 
Your Name...
Posted: Sun Oct 18, 2009 5:15 am
Guest
"senriz" <dbsenriz at (no spam) gmail.com> wrote in message
news:84f50922-b923-4ca7-8fcf-99b7df802831 at (no spam) a37g2000prf.googlegroups.com...
Quote:

Thank you so very much!! I got it to work beautifully. I actually
had put each page on a layout all by itself when a form had multiple
pages, so that ended up being a bit easier. Also, I got the Landscape
and Portrait print to work quite well. I add the Print Setup Function
above the Print Function enabling either Portrait or Landscape when a
Form's orientation changed. So if the first Five Forms were Portrait
I only needed to put that Function in the first one, then change it
for Form 6 to Landscape, and then only change it again when one of the
following Forms changed back to Portrait. Again, thank you. Your
instructions were extremely helpful.

Not quite. You'll need to put the Page Setup command in EVERY Form's "If /
EndIf" section - otherwise if they don't choose to print Form 1 the Page
Setup could be set incorrectly (e.g. a left-over from printing just Form 6
previously) whrn printing Forms 2, 3, 4 or 5.

Helpfull Harry Surprised)
 
senriz...
Posted: Wed Oct 28, 2009 9:11 pm
Guest
On Oct 17, 9:49 pm, "Your Name" <your.n... at (no spam) isp.com> wrote:
Quote:
"senriz" <dbsen... at (no spam) gmail.com> wrote in message

news:84f50922-b923-4ca7-8fcf-99b7df802831 at (no spam) a37g2000prf.googlegroups.com...



Thank you so very much!!  I got it to work beautifully.  I actually
had put each page on a layout all by itself when a form had multiple
pages, so that ended up being a bit easier.  Also, I got the Landscape
and Portrait print to work quite well.  I add the Print Setup Function
above the Print Function enabling either Portrait or Landscape when a
Form's orientation changed.  So if the first Five Forms were Portrait
I only needed to put that Function in the first one, then change it
for Form 6 to Landscape, and then only change it again when one of the
following Forms changed back to Portrait.  Again, thank you.  Your
instructions were extremely helpful.

Not quite. You'll need to put the Page Setup command in EVERY Form's "If /
EndIf" section - otherwise if they don't choose to print Form 1 the Page
Setup could be set incorrectly (e.g. a left-over from printing just Form 6
previously) whrn printing Forms 2, 3, 4 or 5.

Helpfull Harry  Surprised)

Sure enough. That is what happened. Thank you.
 
 
Page 1 of 1    
All times are GMT
The time now is Mon Nov 30, 2009 1:00 pm