create custom preview windows
when i use a custom preview window with tfrxpreview component, i want to show page appointed when formshow,but it does'nt work
eg.
if AfrReport = nil then Exit;
try
if not Assigned(frmPreviewReport) then
frmPreviewReport := TfrmPreviewReport.Create(Application);
AfrReport.Preview := frmPreviewReport.FPreview;
frmPreviewReport.Init;
frmPreviewReport.FPreview.OutlineVisible := False;
if AfrReport.PrepareReport then
begin
AfrReport.ShowReport(True);
frmPreviewReport.FPreview.PageNo := CurPage;
frmPreviewReport.ShowModal;
end;
finally
AfrReport.Preview := nil;
frmPreviewReport.Free;
frmPreviewReport := nil;
end;
how can i set the preview PageNo?
eg.
if AfrReport = nil then Exit;
try
if not Assigned(frmPreviewReport) then
frmPreviewReport := TfrmPreviewReport.Create(Application);
AfrReport.Preview := frmPreviewReport.FPreview;
frmPreviewReport.Init;
frmPreviewReport.FPreview.OutlineVisible := False;
if AfrReport.PrepareReport then
begin
AfrReport.ShowReport(True);
frmPreviewReport.FPreview.PageNo := CurPage;
frmPreviewReport.ShowModal;
end;
finally
AfrReport.Preview := nil;
frmPreviewReport.Free;
frmPreviewReport := nil;
end;
how can i set the preview PageNo?
Comments
AfrReport.ShowPreparedReport;
instead of
AfrReport.ShowReport(True);
It' right, Thanks