Load archivefile during archivereader is visible?
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
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
This discussion has been closed.
Comments
Sorry i forgot to inform that I use RB 6.03 and Delphi6.
Best regards
Robert
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
http://www.digital-metaphors.com
info@digital-metaphors.com