Is it possible to have multiple instances of a custom preview on screen if its not modal .. SO they can prievew two documents at the same time in two windows ?
I am creating them dynamically using Loadfromdatabase Then Print .. The custom preview window is displayed automatically .. How do i direct it to instance a new preview window ?
So you would need to dynamically create the TppReport objects and load the templates from database based on how many reports you would like to view at the same time. If the custom preview is properly registered there it will automatically be displayed. Example... (this is rough psuedo code).
var lReport: TppReport; lList: TList; liIndex: Integer; begin
lList := TList.Create;
try for (liIndex := 0 to NumberOfReports - 1) do begin lReport := TppReport.Create(nil); lReport.Template.DataBaseSettings.... lReport.Template.LoadFromDatabase; lReport.ModalPreview := False; lReport.Print;
lList.Add(lReport); end;
finally for (liIndex := lList.Count -1 down to 0) do lList[liIndex].Free; end; end;
yes had already spotted it foloowing your note . was assigning them to teh same PPreport (sorry)
While your at it .. I have added an email buttin to the Preview Page . i need to run ExportToPdf(PPreport1.. code .. what is the paramater from the Customeviewer that gets me back to the report
What i need is something like ExportToPDF(PPViewer1.Report,Filename) .. But Report points to a PPProducer not a PPreport
TppProducer is the ancestor of the TppReport object. If you typecast the Report property as a TppReport object, you will have full access to the report.
Comments
Yes, but you will need to create or place multiple TppReport objects on your
form in order to view more than one report at the same time.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
custom preview window is displayed automatically .. How do i direct it to
instance a new preview window ?
So you would need to dynamically create the TppReport objects and load the
templates from database based on how many reports you would like to view at
the same time. If the custom preview is properly registered there it will
automatically be displayed. Example... (this is rough psuedo code).
var
lReport: TppReport;
lList: TList;
liIndex: Integer;
begin
lList := TList.Create;
try
for (liIndex := 0 to NumberOfReports - 1) do
begin
lReport := TppReport.Create(nil);
lReport.Template.DataBaseSettings....
lReport.Template.LoadFromDatabase;
lReport.ModalPreview := False;
lReport.Print;
lList.Add(lReport);
end;
finally
for (liIndex := lList.Count -1 down to 0) do
lList[liIndex].Free;
end;
end;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
same PPreport (sorry)
While your at it .. I have added an email buttin to the Preview Page . i
need to run ExportToPdf(PPreport1.. code ..
what is the paramater from the Customeviewer that gets me back to the report
What i need is something like ExportToPDF(PPViewer1.Report,Filename) ..
But Report points to a PPProducer not a PPreport
TppProducer is the ancestor of the TppReport object. If you typecast the
Report property as a TppReport object, you will have full access to the
report.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com