Topic Options
#57253 - 10/18/19 10:38 AM Creating Data Groupings on main body of PP Page
Thomas Offline
OL Toddler

Registered: 04/30/03
Posts: 36
Loc: Florida
Hello,

I am creating a client invoice in which the main body of the page has all the services fees broken out by a project. So for each Project (or Category) there will be a group of Service Fees that are invoiced. It would look something like the below.
Project: ABC Business Unit
Service Fee 1 10 $100.00
Service Fee 2 5 $150.00
Service Fee 3 $100.00
Subtotal $350.00
Project: ZZZ Business Unit
Service Fee 1 10 $100.00
Service Fee 2 5 $150.00
Service Fee 3 $100.00
Subtotal $350.00
Project: BRAGS Business Unit
Service Fee 1 10 $100.00
Service Fee 2 5 $150.00
Service Fee 3 $100.00
Subtotal $350.00
Total $1,050.00


In addition, How do you page break?

Any help would be much appreciated.
Thanks
-T


Edited by Thomas (10/18/19 10:39 AM)

Top
#57254 - 10/18/19 11:58 AM Re: Creating Data Groupings on main body of PP Page [Re: Thomas]
Jean-Cédric Offline
OL Expert

Registered: 10/03/16
Posts: 475
Loc: Québec, Canada
You would need to use PressTalk in order to build your body and handle the overflow. Please start by reading the following documentation in order to grasp the rest of my explanations/examples:

So lets start by dealing with what could be static like header and footer. Given that your header usually contains company logo, customer address, customer number, etc... and that the footer contains other fixed position information, that leaves us with the middle part (body) to fill-up and handle overflow. For example sake, let's say that the body is 6 inches.

Setup, on an overlay, your header and footer.

Now we need to deal with the body. In your case, using the Line repeat and data overflow wouldn't probably be the best approach as it is usually for line data that repeat themselves without another different level of information.

So in your case, you would require a Run page. On that Run page, you need a PressTalk object (script) that will call other form pages and position them accordingly to your Y axis.

Theses other form pages would contains the equivalent of 1 detail line. The data selection in it would have a global variable as the line number so it knows which line you currently are dealing with from your Run script. In your case, I foresee 4 of them:
  • Project category
  • Service fee
  • Subtotal
  • Total

Each, also setup as an overlay (an overlay doesn't print by itself).

On the Run page, your PressTalk object would be position at the top/left of the page (0,0). You might be tempted to position it already just below the header but once the first page is printed and it starts handling overflowing pages, it will go back to position (0,0) in memory.

In your PressTalk object,from a loop that goes through all your data lines, you will conditionally call each of these form pages. You will also need to keep track of your position on the output page to know when to execute the showpage() command and start a new output page.
You code would follow this kind of logic:
  • Execute the Header/Footer form page (as a background)
  • Offset down to just below the header (start of the body)
  • Loop through your data line and call the corresponding form page while setting the current line number into your line global variable
  • Execute the Showpage() command once you have filled the 6 inches body of your output page or reached the end of the data file
  • Execute the Header/Footer form page after the Showpage() command if you still have output page to generate
  • Offset down to just below the header (start of the body of the following output page)
  • Loop....

That should get you started. The implementation rest on your programming skills.

Top