Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grand total at last page 1

Status
Not open for further replies.

nagendra

Programmer
Jun 27, 2000
4
US
Hi,<br><br>&nbsp;&nbsp;I am Nagendra, i have some problem in my report.<br>I want print grand total at the last page and the fixed place. it should print at same place irrespective of no.of records.<br><br><br>regards <br>Nagendra P.
 
Firstly you need to set-up a query in the 'before-report-trigger' to <br>count how many records your main query will bring back.&nbsp;&nbsp;<br><br>The following query is in my 'before-report-trigger' and immitates my<br>main query ..<br><br> select count(*)<br> into :p_no_recs<br> from customer;<br><br>Eg. I have a main query that brings back 105 records therefore :p_no_recs = 105<br><br>In my main query I have a formula column as follows:<br><br>function CF_1Formula return Number is<br>begin<br>&nbsp;&nbsp;:p_count := :p_count + 1;<br>return :)p_count);<br>end;<br><br><br>I have a summary column cs_grand_tot, at report level enclosed by a frame M_1, print condition MUST BE all<br><br>On M_1 I have a format trigger:- <br><br>function M_1FormatTrigger return boolean is<br>begin<br>if :p_count = :p_no_recs then<br>&nbsp;&nbsp;return (TRUE);<br>else<br>&nbsp;&nbsp;return (FALSE);<br>end if;<br>end;<br><br>Now for the important bit ... if you want the grand total to appear in a fixed position anywhere on the last page you must place the frame above the main query frame ... and OVERLAPPING it (not outside or inside)<br><br>It must not sit within the main query's frame becase this causes the <br>grand total to appear after the main frame records.<br><br>It works, give it a go !<br><br>Cheers<br>Greg B.<br><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top