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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing formula on each report copy

Status
Not open for further replies.

bobgsysop

Programmer
Nov 3, 2000
25
US
I need a formula to print different text based on which copy of the report is printing. I'm using the RDC with DSR, in VB6.

Example:

The report prints 3 copies - the first should print "OFFICE" in the footer, the next "ACCOUNTING" and the last, "CUSTOMER".

I have:
Report.FormulaFields(12).Text = "'OFFICE'"
Report.PrintOut False

which works fine, but following it with:

Report.FormulaFields(12).Text = "'ACCOUNTING'"
Report.PrintOut False
Report.FormulaFields(12).Text = "'CUSTOMER'"
Report.PrintOut False

gives two more reports with the word "OFFICE" on them.

Thanks in advance for any help you could give.

Regards,
BobG



 
Hi !

Are the three copies identical ?

If they are, you can save your report with
print properties "Number of copies = 3",
and then you can check your formula like this:

if PageNumber = 1 then
'OFFICE'
else if PageNumber = 2 then
'ACCOUNTING'
else if PageNumber = 3 then
'CUSTOMER'

/Goran
 
Hi Goran-

Thanks, but that didn't work. I suspect that the number of pages isn't incremented when you select multiple copies.

I worked around it by putting all of the report parameters into a sub routine, then called the subroutine three times, with diferent footer text for each copy. Basically, I printed three reports, instead of 3 copies of one.

Regards,
Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top