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

Load archivefile during archivereader is visible?

edited May 2003 in Devices
Hi

How can i load a archivefile during the archivereader is already visible
(Showmodal = false)?
Our app looks like this: there is a list where you can select a reportfile
(archivefile) and there is a previewform (archivereader) where the selected
report (archivefile) is show. But when i go to the next report the preview
is empty (white paper). How can i clear the old archive?

Code:

function Tform.ShowArchive;
var aArchiveFileName: string;
begin
inherited;
qryReport.Close;
qryReport.ParamByName('id').AsInteger := cdsMainID.AsInteger;
qryReport.Open;
if qryReport.Recordcount > 0 then begin
aArchiveFileName := GetTempFile('rep');
qryReportBlob.SaveToFile(aArchiveFileName);
arMain.ArchiveFileName := aArchiveFileName;
arMain.ModalPreview := false;
arMain.DeviceType := 'Screen';
arMain.Print;
end;

Thanks in advance

Robert

Comments

  • edited May 2003
    Hi

    Sorry i forgot to inform that I use RB 6.03 and Delphi6.

    Best regards

    Robert
  • edited May 2003
    Everytime you call arMain.Print, a preview form is created. Perhaps you
    should use a TppViewer component on a TForm and simply call
    arMain.PrintToDevices instead of multiple calls to arMain.Print. This way
    you can use one viewer and move between reports without showing different
    preview forms. See the main reports demo for an axample of using a TppViewer
    in a main form to prevew many different reports.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.