create custom preview windows

edited 5:21AM in FastReport 3.0
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?

Comments

  • edited 5:21AM
    should be
    AfrReport.ShowPreparedReport;
    instead of
    AfrReport.ShowReport(True);
  • edited 5:21AM
    Great!
    It' right, Thanks

Leave a Comment