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

How to insert report objects with adjusted defaults settings?

edited October 2009 in General
Hello,
I would like to have an ability to change the predefined options of an
object, when the end user is adding that object to the report.
An example:
if I add an ppImage to my report, the settings "Stretch" and
"MaintainAspectRatio" both are set to false by default. I would like to have
them set to true everytime the user add an other ppIgame / ppDBImage to his
reports.

So either a way to change those setting in general or a way (event) to
change them when the ppImage is being adding.

How can I achieve that?

Comments

  • edited October 2009
    Hi Mark,

    You can use the Designer.OnCreateComponent event to initialize certain
    components when they are added to a report...

    uses
    ppCtrls;

    procedure TForm2.ppDesigner1CreateComponent(Sender: TObject; Component:
    TComponent);
    begin

    if Component is TppImage then
    TppImage(Component).Stretch := True;

    end;

    Another option would be to create your own custom component and register it
    with ReportBuilder. See the demo located in the \Demos\6. RCL\... directory
    for an example of this.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2009
    Hi Nico,
    somehow I keep forgetting the ppDesigner most of the time and am looking for
    such events within the ppReport...

    With your tip it works perfectly, thank you very much!

    Mark

This discussion has been closed.