Suppress preview - number of pages shown

edited 6:56AM in FastReport 4.0
As topic says, Is there a way to stop preview from showing all pages if they go over an arbitrary number, e.g. 3 pages?

OnPrintPage does not do what I thought it does (it actually is used when physically printing pages, not when "printing"/showing pages in Preview).

Iv'e tried :
OnPrintPage (see above)
Report.PreviewPages.Count can not be assigned to
PrintOptions.PageNumbers is also just used when physically printing pages.

Comments

  • edited 6:56AM
    Gisli wrote: »
    As topic says, Is there a way to stop preview from showing all pages if they go over an arbitrary number, e.g. 3 pages?

    OnPrintPage does not do what I thought it does (it actually is used when physically printing pages, not when "printing"/showing pages in Preview).

    Iv'e tried :
    OnPrintPage (see above)
    Report.PreviewPages.Count can not be assigned to
    PrintOptions.PageNumbers is also just used when physically printing pages.

    Did a little digging and solved it. Connected the Event OnProgress in the report to the following:
    procedure TReportManager.OnProgress(Sender: TfrxReport;
      ProgressType: TfrxProgressType; Progress: Integer);
    begin
      If Progress >= 3 then
        Sender.Engine.StopReport;
    end;
    

    Works like a charm for me at least. Of course this method is only connected in the instance when i want to suppress the preview.

Leave a Comment