Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Display an archive file in ppViewer

edited March 2012 in General
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

Comments

  • edited March 2012
    Update:

    Using a ppDBArchiveReader or loading the archive from file: both works
    fine. So I'll use ppDBArchiveReader.

    Thanks anyway.

    Uli
This discussion has been closed.