Jump to content
Sign in to follow this  
Lynn

Save Records as PDF

Recommended Posts

I'm trying to write a script to generate invoices for a group of players by team, save to PDF and eventually email the PDF out. Problem is when I select a particular team, each saved pdf has multiple players' invoices instead of the just one filename = one player. Strange part is the saved pdf for each is different i.e. one file might have 8 different pages (8 different players) while another might have 10. Again, just looking for one filename (dynamic to pull player name) to equal one player, not multiple. Here's the script...Please help!

Go to Layout [“Invoice PDFs” (Billing)]

Print Setup [Restore; With dialog: Off]

Enter Find Mode [Pause: Off]

Perform Find [ ]

Sort Records [Restore ; With dialog: Off]

Loop

            Set Variable [$Filepath ; Value: Get(DesktopPath) & Player_Person::Player_FullName & “.pdf”]

            Save Records to PDF [Restore ; With dialog: Off ; “$FilePath” ; Records being browsed]

            Set Variable [$PlayerIDTEST]

            Set Variable [$BillingIDTEST]

            Loop

                        Omit Record

                        Exit Loop If [Player_Person::Player_ID =$PlayerIDTEST and Billing::Billing_ID = $BillingIDTEST]

            End Loop

            Exit Loop If [Get(FoundCount)=0]

End Loop

 

Share this post


Link to post
Share on other sites

I suspect that the problem is with the 'Records being browsed' option being checked for the Save Records to PDF step.

What exactly is a record in the Billing table and how many of them make up an invoice?

--
P.S. Please update your profile  to reflect your version  and OS, so that we know what you can use

 

Edited by comment

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.