Display an archive file in ppViewer
Hi,
maybe I am blind, but I couldn't find any code just to display archived
reports (in a database) using TppArchiveReader and TppViewer.
I tried:
Viewer.report := MyReader;
procedure TServiceForm.DisplayBefundFromArchiv;
var
MyStream: TMemoryStream;
begin
Viewer.Reset;
Viewer.Report.Reset;
MyStream := TMemoryStream.Create;
try
TermineQueryPrintFile.SaveToStream(MyStream);
Reader.ArchiveStream := MyStream;
try
Viewer.Report.PrintToDevices;
except
Application.MessageBox('xxx');
end;
finally
MyStream.Free;
end;
end;
Setting Viewer.SinglePageOnly = true works: the first page of a stored
report is displayed correctly.
Setting SinglePageOnly = false results in displaying nothing.
I also tried Viewer.print, but that always prints to a printer.
Is there any sample code which demonstrates just how to load a stored
archivefile into a viewer and display it?
Thanks and regards Uli
maybe I am blind, but I couldn't find any code just to display archived
reports (in a database) using TppArchiveReader and TppViewer.
I tried:
Viewer.report := MyReader;
procedure TServiceForm.DisplayBefundFromArchiv;
var
MyStream: TMemoryStream;
begin
Viewer.Reset;
Viewer.Report.Reset;
MyStream := TMemoryStream.Create;
try
TermineQueryPrintFile.SaveToStream(MyStream);
Reader.ArchiveStream := MyStream;
try
Viewer.Report.PrintToDevices;
except
Application.MessageBox('xxx');
end;
finally
MyStream.Free;
end;
end;
Setting Viewer.SinglePageOnly = true works: the first page of a stored
report is displayed correctly.
Setting SinglePageOnly = false results in displaying nothing.
I also tried Viewer.print, but that always prints to a printer.
Is there any sample code which demonstrates just how to load a stored
archivefile into a viewer and display it?
Thanks and regards Uli
This discussion has been closed.
Comments
Using a ppDBArchiveReader or loading the archive from file: both works
fine. So I'll use ppDBArchiveReader.
Thanks anyway.
Uli