Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Controling previewing - how?

edited February 2005 in General
Hi,

How can i do to interate with a report mechanism during preparing pages to
print (in the staus bar of preview appear - Calculating page X of Y).?

Thank?s

Gustavo

Comments

  • edited February 2005
    Hi Gustavo,

    Just so I understand correctly, you would like the status bar in the preview
    form to display "Calculating page X of Y" rather than just "Calculation Page
    X"? If this is the case, you will need to create a two pass report as the
    report engine has no idea how many pages are in the report before
    generation. Please clarify what you are trying to accomplish.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2005
    Nico

    I want access the event or code program that is response to display
    "Calculating page X of report-name "xyz".

    In my report, i used control with PPGROUP.NEWPAGETHRESHOLD but i try without
    success knew remaning space of page ou how many space was used until a
    moment of break, ok? (sorry my bad english).

    I need force page break when:
    - the remain space less than midle of page (paper A4, landscape) OR
    - the tppgroup.field was changed

    My Rb. is 6.02 with D.5.

    Thank you

    Gustavo




  • edited February 2005
    Hi Gustavo,

    1. When setting the NewPageThreshold property, remember to use the report
    units. For instance if you are using millimeters as your report units, you
    will need to set the NewPageThreshold to approximately 148 in order for the
    page to break if there is less than 1/2 page left.

    2. It is possible to completely customize the preview form by creating a
    preview plugin. This way you will have complete control over the status
    bar. See the article below for more information. I also posted a link to
    an example of creating a preview plugin.

    http://www.digital-metaphors.com/tips/PreviewPlugIn.zip

    -----------------------------------------
    Article: Creating a Preview Plugin
    -----------------------------------------

    Q: I've followed the tutorials and registered a Preview Form replacement but
    that did not affect the TppDesigner's Preview workspace.


    A: Do not use the form replacement, but rather, there is a different
    architecture built into the preview form that is registered by default.



    You will need to register a TppPreview descendent. The class you register
    is used to create the preview controls inside the standard print preview
    form and the designer preview workspace.


    Here is an example of creating a simple custom preview that access the
    viewer its been assigned in order to change the page color. You can also do
    more advanced operations such as adding and removing buttons and change the
    behavior of the preview form. Access the inherited controls via. protected
    properties and override the virtual methods in order to customize behavior.

    Open ppPreview.pas and view the TppPreview class as a guide to create a
    custom preview descendent.


    unit MyPreviewPlugin;

    interface

    uses
    ppPreview;

    type
    TMyPreviewPlugin = class(TppPreview)
    public
    procedure BeforePreview; override;

    end;


    implementation

    uses
    Graphics;


    procedure TMyPreviewPlugin.BeforePreview;
    begin
    inherited BeforePreview;

    Viewer.PageColor := clRed;

    end;

    initialization
    TppPreviewPlugIn.Register(TMyPreviewPlugin);

    finalization
    TppPreviewPlugIn.UnRegister(TMyPreviewPlugin);

    end.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2005
    Nico, good afternoon,

    Very useful its tip of remaining space in a page. You have registered as to
    determine the area of impression for a report and which the factor of to be
    applied conversion when will have Header/footer-band's? To consider size of
    paper (Letter or A4) and format of print ( LANDSCAPE or PORTRAID)?

    Thank you

    Gustavo




  • edited February 2005
    Hi Gustavo,

    These are all things you will need to check perhaps in the
    Report.BeforePrint event. Then based on the value of these properties (i.e.
    PrinterSetup.Orientation, PrinterSetup.PaperHeight, etc) you can set the
    NewPageThreshold property accordingly. You can also detect if the header
    and footer bands are visible and adjust the number with relation to that.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.