Suppress preview - number of pages shown

edited 12:17PM 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 12:17PM
    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

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.