9.01, PDF Stream, RAP Function, HELP!!!!
Hi everyone,
Let me explain what I am trying to do.
I have a customer who wants to store a copy of a printed report in PDF
format into a database so they can always reprint it later. It is a legal
requirement of theirs as they are a finance company.
What I was trying to do was create a RAP Function that accepted some
variables from the Report (reference fields and such) as well as a
TMemoryStream to pass the PDF into to.
I think I am not on the correct track with my approach.
I need help in the following areas.
1. Creating a PDF Stream even when the user has printed to the Printer.
2. Detecting when the user has printed the report, I have tried to attach to
ReportAfterPrint, but it NEVER fires.
Any help would be appreciated.
Thanks in advance for any help you can give me.
Regards,
Daniel
Let me explain what I am trying to do.
I have a customer who wants to store a copy of a printed report in PDF
format into a database so they can always reprint it later. It is a legal
requirement of theirs as they are a finance company.
What I was trying to do was create a RAP Function that accepted some
variables from the Report (reference fields and such) as well as a
TMemoryStream to pass the PDF into to.
I think I am not on the correct track with my approach.
I need help in the following areas.
1. Creating a PDF Stream even when the user has printed to the Printer.
2. Detecting when the user has printed the report, I have tried to attach to
ReportAfterPrint, but it NEVER fires.
Any help would be appreciated.
Thanks in advance for any help you can give me.
Regards,
Daniel
This discussion has been closed.
Comments
Ignore Question 1
I can create a PDF even after print, I have sorted that out.
I am still having desperate trouble finding out whether it has been printed
or not.
I have attached to
AfterPrint
BeforePrint
OnPrintingComplete
Just to see, and NONE of them are fired at anytime.
here is my code.
procedure TReportLauncher.LaunchInternalReport;
Var
CustomAutoSearch : Boolean;
Begin
CustomAutoSearch := False;
If Not BlankStr(FParam) Then
Begin
ReportParams.Add('MAINPARAM='+FParam);
End;
ReportViewerVars.FParamName := GetParamFileName(FLaunchReportName);
FReport := TppReport.Create(Application);
FReport.OnPrintingComplete := EndJobEvent; //DOES NOT FIRE
FReport.BeforePrint := BasicReportBeforePrint; //DOES NOT FIRE
FReport.AfterPrint := BasicReportAfterPrint; //DOES NOT FIRE
If Not SubStr('\',FLaunchReportName) Then
FLaunchReportName := EnpriseInfo.ApplicationPath+FLaunchReportName;
FReport.Template.FileName := FLaunchReportName;
FReport.Template.LoadFromFile;
FReport.PreviewFormSettings.WindowState := (wsMaximized);
FReport.PreviewFormSettings.ZoomSetting := zs100Percent;
If FPreviewReport Then
FReport.DeviceType := dtScreen
Else
Begin
FReport.ShowPrintDialog := False;
FReport.DeviceType := dtPrinter;
End;
If FileExists(FParamName) Then
Begin
ParamFields := TReportParamFields.Create;
ParamFields.CreateFields(Nil,Nil,ConnectionDM.MainConnection,FParamName,Fals
e);
If Not AutoAssignParamValues(FReport) Then
Begin
If FileExists(FParamName) Then
Begin
ppRegisterForm(TppCustomAutoSearchDialog, TfrmCustomSearchDialog);
CustomAutoSearch := True;
End;
End
Else
FReport.ShowAutoSearchDialog := False;
End;
FReport.Print;
If CustomAutoSearch Then
ppUnRegisterForm(TppCustomAutoSearchDialog);
FReport.Free;
If Assigned(ParamFields) Then
ParamFields.Free;
End;
Please any help.
Dan
In my quick testing with RAP, the AfterPrint event seemed to fire correctly.
Note that when you are "printing" to the screen (previewing) the AfterPrint
event will not fire until you are finished with the preview window and
either close it or change back to the designer.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com