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

Template Files & Outline Pane

edited April 2006 in End User
Chaps

I have a report that was designed in the end user report designer.
(Interbase backend for ref)

The report component has the Outline settigns turned on.

All new reports show the outlline pane in Print Preview
All the old reports do not

Question 1 - Is the above correct or should I always see the Pane, or indeed
just for new reports

Question 2 - I want the Outline Pane but for one particular report I do not
(user request!!)

Can I modify the template field in the database to remove the outline pane
(assuming its stored here - depends on answer to q 1)

If so how do i do this

Cheers

Mark

Comments

  • edited April 2006
    Hi Mark,

    Which version of ReportBuilder are you currently using and which version
    were the old template created in? My suggestion would be to use the
    OnLoadEnd event of the template object to enable or disable the outline
    based on the users request. The OnLoadEnd event fires just after the
    template has been loaded into the report object so if you are loading an
    older template, it will have gone through the conversion process. Take a
    look at the following article on using template events. You will want to
    toggle the Report.OutlineSettings.Visible and Enabled property.

    ----------------------------------------------
    Tech Tip: Using Template Events
    ----------------------------------------------

    The Report.Template object has several events that can be used for
    customizing what happens when a report is loaded or saved:

    - OnLoadStart
    - OnLoadEnd
    - OnNew
    - OnSaveStart
    - OnSaveEnd


    The OnLoadEnd and OnNew events are often used to perform actions related
    to report and data initialization.

    The OnSaveEnd event is often used to save additional descriptive
    ("meta") data to the database each time the report is saved.

    Example:

    The Report.Template events are public and therefore must be assigned at
    run-time.


    1. In the private section of your form declaration you can declare an
    event-handler method:

    TForm = class(TForm)
    private
    procedure myTemplateOnLoadEndEvent(Sender: TObject);

    public

    end;


    2. In the Form.OnCreate event, you can assign the event-handler to the
    event:

    procedure TForm1.FormCreate(Sender: TObject);
    begin

    ppReport1.Template.OnLoadEnd := myTemplateOnLoadEndEvent;

    end;


    3. Implement the event-handler method:

    procedure TForm1.myTemplateOnLoadEndEvent(Sender: TObject);
    begin

    {add code here to initial the report or data, etc. }
    ppReport1.PrinterSetup.MarginTop := 0.5;

    end;


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2006
    Nico
    Version 7.04

    If I set the ppReport to False (OutlineSettings visible, enabled etc) the
    outline is still shown.

    So that must mean it is stored in the template I guess....

    So I assume the only way is as you describe below ?

    That means that I would have to do this with every report if the user wants
    all reports to now exclude the Outline Pane...must be an easier way than
    that surely

    Thanks for your prompt replies....

    Cheers

    Mark

  • edited April 2006
    Hi Mark,

    If you impliment the OnLoadEnd event of the template, it will be fired every
    time a new template is loaded automatically. This is a matter of adding the
    event to your application once (a few lines of code). If you take a look at
    the article I sent in my previous post, once the event is assigned, the top
    margin will be set for every template that is loaded in that application.
    Simple :).

    --
    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.