Page 1 of 1

Conditional printing based on copy number

Posted: Sat May 05, 2007 9:55 am
by Fabio Pagano
I have a report printed in three copies. On the first copy i need to print a text "Copy for the customer", on the second copy i need to print "Internal use copy" and on the third i need to print "Accounting use copy".

I have seen the "Conditions" in text editor but doesn't seem to be something like "IfCopyNumber=1 then".

Any suggestion?

Thanks.

Conditional printing based on copy number

Posted: Sat May 05, 2007 10:28 am
by EDV Gradl
I use a variable which I set before each printing.

Just define a variable CopyNo int

and set it before printing

report["CopyNo"] = 1

Now you can use if or switch to set the right text in an GeValue event of a textbox.

I hope that helps.

Marco

Conditional printing based on copy number

Posted: Sat May 05, 2007 10:36 am
by Fabio Pagano
In my case the printing is from a serialized report (.mdz or .mdc), so GetValue event is not fired.

Thanks.

Conditional printing based on copy number

Posted: Sat May 05, 2007 2:19 pm
by EDV Gradl
Then you could use the

StiPage.PagePainted
StiPage.PagePainting

events.

There you can add anything to the already rendered report.

Marco

Conditional printing based on copy number

Posted: Sat May 05, 2007 6:36 pm
by Fabio Pagano
Ok, thanks, but i was hoping in something more automatic, eg. a condition on the component (something like "Print only on copy n. 1").

Conditional printing based on copy number

Posted: Mon May 07, 2007 5:09 am
by Edward
In that case you need to Call report.Print() 3 times without showing Standard Printing dialog.

We cannot control printing procedure with multi copies because we do not process this procedure this really controls Windows.

Thank you.