Jump to content
Server Maintenance This Week. ×

Save Records as PDF


Lynn

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

Recommended Posts

  • Newbies

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

 

Link to comment
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
Link to comment
Share on other sites

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