Setting document name from the report
Hi
I need to set the document name from fields in the data pipelines as in :-
Report.PrinterSetup.DocumentName := Customer['JobNo'] + ' - ' +
Customer['CustCode'];
If I put this code in the BeforePrint it works a treat when you print from
the built in preview form but when it's printed without previewing with :-
ppReport.DeviceType := dtPrinter;
ppReport.Print();
It doesn't work and the original name is used.
I have tried pretty much all the possible options for the report and some
will actualy get called and do a change but it seems that at that point the
data is unavailable because i just get " - ".
Thanks
Phil
I need to set the document name from fields in the data pipelines as in :-
Report.PrinterSetup.DocumentName := Customer['JobNo'] + ' - ' +
Customer['CustCode'];
If I put this code in the BeforePrint it works a treat when you print from
the built in preview form but when it's printed without previewing with :-
ppReport.DeviceType := dtPrinter;
ppReport.Print();
It doesn't work and the original name is used.
I have tried pretty much all the possible options for the report and some
will actualy get called and do a change but it seems that at that point the
data is unavailable because i just get " - ".
Thanks
Phil
This discussion has been closed.
Comments
This is a timing issue, the BeforePrint event occurs too late.
Try using the OnInitializeParameters event. I tested with RB 11 and that
event seems to work well - however be aware that this event occurs prior to
the datapipelines being opened.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
So looks like it is not possible then?
thanks