Printing and Archive File Creation at the same time
Hi,
When a user is printing an invoice I want to
automatically create an archive file in a specific
directory.
The following code is used to print the invoice:
ReportPath:= ExtractFilePath(Application.ExeName) + 'Reports\';
lRpt := TppReport.Create(self);
lRpt.Template.FileName := ReportPath+'Invoice.rtm';
lRpt.Template.LoadFromFile;
lRpt.ShowAutoSearchDialog := False;
lRpt.ShowPrintDialog := True;
lRpt.NoDataBehaviors := [ndMessageDialog,ndBlankPage];
lRpt.OnGetAutoSearchValues := AutoSearchValuesEvent;
lRpt.DeviceType := 'Screen';
lRpt.Print;
How do I accomplish this? Do I need to do this in
RAP AfterPrint event?
I use RB Enterprise 12.04, Delphi2010.
Kind regards,
Jerri
When a user is printing an invoice I want to
automatically create an archive file in a specific
directory.
The following code is used to print the invoice:
ReportPath:= ExtractFilePath(Application.ExeName) + 'Reports\';
lRpt := TppReport.Create(self);
lRpt.Template.FileName := ReportPath+'Invoice.rtm';
lRpt.Template.LoadFromFile;
lRpt.ShowAutoSearchDialog := False;
lRpt.ShowPrintDialog := True;
lRpt.NoDataBehaviors := [ndMessageDialog,ndBlankPage];
lRpt.OnGetAutoSearchValues := AutoSearchValuesEvent;
lRpt.DeviceType := 'Screen';
lRpt.Print;
How do I accomplish this? Do I need to do this in
RAP AfterPrint event?
I use RB Enterprise 12.04, Delphi2010.
Kind regards,
Jerri
This discussion has been closed.
Comments
Take a look at the following article.
http://www.digital-metaphors.com/rbWiki/Output/Printer/How_To...Print_to_the_Printer_and_File_Device
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for the link to this article. Some things are more clear now. I am
however curious if this also can be done totally within RAP?
Kind regards,
Jerri
I do not believe you can create file devices in RAP code however it is
possible to do so using pass-thru functions. See the rap demos on how
to create pass-thru functions.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com