How the page break to each Department and calculate totals for Department

I have a stored procedure that queries our sql database and returns the name of the employee, their Department, and a few other calculations. I use CFDocument to create a table and view the results. Here's the code that does this (see below) what I have to do is find a way to create a page break after that I have show a total for each column in each Department. My questions are so

1. How can I insert a page break after the end of each service
2. just above the page break, how to calculate the totals for the Department and display them?

< cfdocument format = "pdf" >
< table width = "650" border = "1" >
< cfoutput query = "getResults" >
< b >
< td > #EmpName # < table >
< td > #Dept # < table >
< td > #JobType # < table >
< td > #NonBill # < table >
< td > #NonBillMeter # < table >
< td > #NumberFormat ((NonBillPercent*100),.00) # < table >
< td > #Bill # < table >
< td > #BillMeter # < table >
< td > #NumberFormat ((BillPercent*100),.00) # < table >
< /tr >
< / cfoutput >
< /table >
< / cfdocument >

If I remember correctly, the tag you want is cfdocumentitem. Also, you want to check the attribute of cfoutput group.

The details are in the cfml reference manual. If you do not have one, has the internet.

Tags: ColdFusion

Similar Questions

Maybe you are looking for