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

Modify RB default printer dialog box

edited October 2014 in General
Hello, I need to modify the default printer dialog box from RB to disable
all fields except the selection printer combo box, is there any way to do
so?
I'm using Delphi XE2 with Report Builder 14.08 build 48.




Thanks in advance.

Comments

  • edited October 2014
    Hi Martin,

    All dialogs in ReportBuilder are replaceable. Take a look at the
    following article on how to replace a dialog in ReportBuilder with your
    own custom one.

    http://www.digital-metaphors.com/rbWiki/Plugins/Dialogs/Replaceable_Dialogs

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2014
    "Nico Cizik (Digital Metaphors)" escribi? en
  • edited October 2014
    Hi Martin,

    It looks the same because it is a copy of the original. The example
    simply copied the existing print dialog, renamed the class and
    registered it to be used instead of the default, but no changes were made.

    Now any changes you make to the MyPrintDlg.pas will show up when you
    print the report. As an example, try adding the following code to the
    TmyPrintDialog.Init; routine in the MyPrintDlg.pas file.

    Color := clRed;

    Now when you run the project and try to print, you will see the print
    dialog is red.

    Note that this example is using an outdated version of the Print Dialog.
    For your final product, I suggest copying the ppPrnDlg.pas file
    located in the \RBuilder\Source\.. directory as your starting point.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2014

  • edited October 2014

    "Martin Acevedo" escribi? en el mensaje
  • edited October 2014
    Hi Martin,

    In the example, at the bottom of the MyPrintDlg.pas file you will see
    the "initialization" and "finalization" sections. Inside there you will
    see calls to register the custom forms with ReportBuilder.

    initialization

    ppRegisterForm(TppCustomPrintDialog, TmyPrintDialog);

    finalization

    ppUnRegisterForm(TppCustomPrintDialog);

    Placing these calls in the init/final section will register the forms
    for your entire application. You can remove these calls and place them
    inside your application code so the form is only used in certain
    circumstances.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2014

  • edited October 2014
    Hi Martin,

    You will need to trace this AV to see what is causing the problem. It
    is likely an invalid object reference.

    If you are able to recreate this issue with a simple example or the
    example we provided in the article, please send it to us and we'll take
    a look at it for you. Send all files in .zip format to
    support@digital-metaphors.com.

    Best Regards,

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