Writing to an archive
Hi,
I'm trying to write my report to an archive and then exporting the .raf file
to PDF with the pragnaan exporter.
The problem is that there is always just one page in the Archive.
Code:
procedure PrintPages;
lDevice : TmyDevice;
i : integer;
begin
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtArchive;
ppReport1.ArchiveFileName := 'c:\test.raf';
lDevice := TmyDevice.Create(Self);
lDevice.EndPrintJob := False;
lDevice.Publisher := ppReport1.Publisher;
for i := 0 to CmboBxInstitutions.Items.Count -1 do
begin
PrintToDevices;
lDevice.Reset;
lDevice.StartPrintJob := False;
if i = CmboBxInstitutions.Items.Count -1 then
lDevice.EndPrintJob := True
else
lDevice.EndPrintJob := False;
end;
ExportArchiveToFile('C:\Test.raf','C:\Test.pdf',ofPDF,True,True,False);
end;
The TmyDevice is a copy of the TmyPDFDevice from examples I used before only
this one is of the class TppDevice instead of TppPDFDevice.
This always just shows the last page of the report.
Thanks
I'm trying to write my report to an archive and then exporting the .raf file
to PDF with the pragnaan exporter.
The problem is that there is always just one page in the Archive.
Code:
procedure PrintPages;
lDevice : TmyDevice;
i : integer;
begin
ppReport1.ShowPrintDialog := False;
ppReport1.DeviceType := dtArchive;
ppReport1.ArchiveFileName := 'c:\test.raf';
lDevice := TmyDevice.Create(Self);
lDevice.EndPrintJob := False;
lDevice.Publisher := ppReport1.Publisher;
for i := 0 to CmboBxInstitutions.Items.Count -1 do
begin
PrintToDevices;
lDevice.Reset;
lDevice.StartPrintJob := False;
if i = CmboBxInstitutions.Items.Count -1 then
lDevice.EndPrintJob := True
else
lDevice.EndPrintJob := False;
end;
ExportArchiveToFile('C:\Test.raf','C:\Test.pdf',ofPDF,True,True,False);
end;
The TmyDevice is a copy of the TmyPDFDevice from examples I used before only
this one is of the class TppDevice instead of TppPDFDevice.
This always just shows the last page of the report.
Thanks
This discussion has been closed.
Comments
Have you been able to contact the Pragnaan staff yet? As I mentioned
before, I do not have access to their source code and therefore do not know
how they are processing each page inside their StartJob and EndJob
overridden routines. Since you are essentially overriding some of their
routines with your custom device, you may need to add some of their code to
your routines to get a proper output.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I have sent repeated mails to their support mail but no answer yet.
I beginning to think I should have bought something a bit more expensive
since then I would probably have gotten some support (or at least an answer
to my e-mails).
It seems that the raf file gengerated by my code is always 32kb whether I'm
gengerating 1 or 20 pages.
I can't open this raf file with anything to check it but I really don't need
to. It ought to be a lot bigger than 32 kb with 70+ pages inside.
The pragnaan exporter opens the last page perfectly so I'm thinking it must
be a problem with the archive writing.