dbTalk Databases Forums  

Print Script Won't Work With More Than 1 Record

comp.databases.filemaker comp.databases.filemaker


Discuss Print Script Won't Work With More Than 1 Record in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
senriz
 
Posts: n/a

Default Print Script Won't Work With More Than 1 Record - 11-29-2009 , 01:06 AM






Hello... I'm a novice using FMP9 Adv. I have a printing script that
is pretty complex and works beautifully when there is only ONE
record. A little background so the script is understood... I have a
layout that has 49 tabs and each tab is represent of a form. The user
selects which form to print in a set by a checkbox. When these forms
get printed they MUST be numbered Pg __ of __. My print checkbox is
called Print1, Print2, etc. When there is more than one record
created whether pertaining to the same student or another I get funky
page numbering, like Pg 14 of 7. And sometimes I get pages from
another record that have been previously saved, while other times a
particular selected form doesn't even print in the set. When I remove
all but one record... it works perfectly. Below is my script, scaled
down due to the multitude of forms. Any help would be greatly
appreciated. Also, please note the second Print to PDF is an
"append". Thanks!!

Set Field [ Global::gTotalPages; IEP::Print1 + IEP::Print2 +
IEP::Print3 ]
Set Variable [ $fileName; Value:"file:" & Get(DesktopPath) &
"GenerateForms" & ".pdf" ]
Set Field [ Global::gPageNumber; 0 ]
Go to Layout [ “IEP Forms” (IEP) ]
If [ ValueCount(IEP::Print1) > 0 ]
Go to Layout [ “Form 1” (IEP) ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Enter Preview Mode
Go to Record/Request/Page [ Last ]
Set Field [ Global::gPageNumber; Global::gPageNumber + Get
( PageNumber ) ]
If [ Global::gPageNumber = 1 ]
Save Records as PDF [ File Name: “$fileName”; Current record ]
[ Restore; No dialog ]
End If
End If
Go to Layout [ “IEP Forms” (IEP) ]
If [ ValueCount(IEP::Print2) > 0 ]
Go to Layout [ “Form 2” (IEP) ]
Print Setup [ Orientation: Landscape; Paper size: 11" x 8.5" ]
[ Restore; No dialog ]
Enter Preview Mode
Go to Record/Request/Page [ Last ]
Set Field [ Global::gPageNumber; Global::gPageNumber + Get
( PageNumber ) ]
If [ Global::gPageNumber = 1 ]
Save Records as PDF [ File Name: “$fileName”; Current record ]
[ Restore; No dialog ]
Else
Save Records as PDF [ File Name: “$fileName”; Current record ]
[ Restore; Append; No dialog ]
End If
End If
Go to Layout [ “IEP Forms” (IEP) ]
If [ ValueCount(IEP::Print3) > 0 ]
Go to Layout [ “Form 3” (IEP) ]
Print Setup [ Orientation: Portrait; Paper size: 8.5" x 11" ]
[ Restore; No dialog ]
Enter Preview Mode
Go to Record/Request/Page [ Last ]
Set Field [ Global::gPageNumber; Global::gPageNumber + Get
( PageNumber ) ]
If [ Global::gPageNumber = 1 ]
Save Records as PDF [ File Name: “$fileName”; Current record ]
[ Restore; No dialog ]
Else
Save Records as PDF [ File Name: “$fileName”; Current record ]
[ Restore; Append; No dialog ]
End If
End If
Enter Browse Mode
Go to Layout [ “IEP Forms” (IEP) ]

Reply With Quote
  #2  
Old   
senriz
 
Posts: n/a

Default Re: Print Script Won't Work With More Than 1 Record - 12-01-2009 , 10:09 PM






No need to reply. Problem resolved.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.