Qreport中的源代码,可以看看
procedure TMyPrevForm1.LoadReportClick(Sender: TObject);
begin
with TOpenDialog.Create(Application)do
try
Title := '读取报表';
Filter := '报表文件' + ' (*.' +cQRPDefaultExt + ')|*.' + cqrpDefaultExt;
if Execute then
if FileExists(FileName) then
begin
QRPreview.QRPrinter.Load(Filename);
QRPreview.PageNumber := 1;
QRPreview.PreviewImage.PageNumber := 1;
UpdateInfo;
PrintSetup.Enabled := False;
Print.Enabled := true;
end
else
ShowMessage('文件不存在!');
finally
free;
end;
end;