create custom preview windows

edited 4:44AM 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 4:44AM
    should be
    AfrReport.ShowPreparedReport;
    instead of
    AfrReport.ShowReport(True);
  • edited 4:44AM
    Great!
    It' right, Thanks

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.