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

How do I do?

edited September 2008 in End User
I'd like to know how do I do for to change all windows the Report Builder?
Will I need to change the code fonts of the Report Builder? Or with
inheritance I'm going to can to do it?

How do I do?


Juliano Rafael Silva Barros

Comments

  • edited September 2008
    Hi Juliano,

    Do you mean you would like to replace all the dialogs and forms in
    ReportBuilder (i.e. Preview, Explorer, Designer, etc.) or all reports you
    have saved in RB format? For the former, it is quite possible to replace
    all dialogs and forms with the exception of the designer with your own
    custom creations. See the article below for more information.

    ------------------------------------------------------------
    Tech Tip: Replacing Built-in Dialogs/Forms in ReportBuilder
    ------------------------------------------------------------

    ReportBuilder has an open architecture for replacing any of the built-in
    dialogs. You can replace any of the built-in dialogs by creating a new form
    that inherits from an abstract ancestor and then registering it as the new
    built-in dialog.

    For example to replace ReportBuilder's print dialog you could

    1. Create a new Print dialog by renaming ReportBuilder's default print
    dialog, then doing a SaveAs to save it under another unit name.

    The default dialog resides in RBuilder\Source\ppPDlg.pas and the form is
    called ppPrintDialog. You should assign your form a unique name, for
    example, myPrintDlg, and save the unit to another name. Also save the unit
    to the directory where your other forms are stored (not RBuilder\Source).

    2. Make desired changes.

    You will notice that the print dialog inherits from an ancestor
    TppCustomPrintDialog - this ancestor resides in ppForms.pas (where all the
    abstract ancestor forms for ReportBuilder are defined).

    3. Register the new form.

    Declare an initializtion section at the bottom of the unit:

    initialization

    ppRegisterForm(TppCustomPrintDialog, TMyPrintDialog);


    4. Add the new unit to your project and compile.

    Now your preview dialog should be automatically created and destroyed by
    ReportBuilder. The two page preview dialog in the
    RBuilder\Demos\Reports\Demo.dpro was created this same way. The only
    difference is the ppRegisterForm call is in then OnClick event of the
    button.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    Hi Nico, thanks for answer me, I'd like of change the in the designer when
    try to save, don't replace the Reports that I defined, as a control, I
    created a field in the DB where I did the this control, if could to save or
    no. Do you understand? In the items table a field call 'sistem' that
    indicate if it's the system or of the user and I don't allow replace the
    system's report.

    How do I do it?

    Juliano Rafael Silva Barros


  • edited September 2008
    Hi Juliano,

    You can use the OnSave event of the TppDesigner to take complete control
    over the report saving process. It is also possible to customize the main
    toolbar of the designer. Take a look at the following example.

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

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2008
    And if the user press CTRL+S or this case CTRL+P? you disable the menu but
    the procedure can be call yet with shortcut what do I do with it? The case
    of the save window I implement the TppCustomTemplateDialog but I have that
    change the TppReportExplorer for to change
    TppReportExplorer.ReportSaveEndEvent and TppReportExplorer.MoveItemToFolder,
    Can I to modify this specific routine without to modify TppReportExplore? or
    Do I modify this class to meet my need?

    Juliano Rafael Silva Barros

  • edited September 2008
    Hi Juliano,

    In this case (as I mentioned in my last post) you should implement the
    OnSave event of the Designer so you have complete control over how the
    report is saved. See the help topic for the OnSave event for more
    information on how it works and take a look at the TppTemplate class located
    in the ppTmplat.pas file for how the report templates are currently saved to
    a database or file.

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