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.
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.
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.
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.
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.
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.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
"Martin Acevedo" escribi? en el mensaje
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.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com