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

Printing Report So-N-So

edited July 2006 in General
I can't seem to find the property that controls the text in the popup print
box when a report goes to the printer. Right now the text says "Printing
page 1 of report Report". Of course I would like this to say "Printing page
1 of ".

rbServer 10 & rsClientReport

Thanks!

Comments

  • edited July 2006
    Hi Jon,

    This is the cancel dialog located in the ppCDlg.pas file.

    ------------------------------------------------------------
    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 July 2006
    Sorry, I just realized there is an easier way. Changing the
    PrinterSetup.DocumentName property of the report object will change the name
    of the document displayed in the cancel dialog.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2006
    Yes, I see it on a ppReport. Is there a way to gain access to this on a
    trsClientReport?

    Thanks!


  • edited July 2006
    Hi Jon,

    The Client Report is not an actual report. The best way to assign the
    document name to reports you are accessing over a server would be to open
    and re-save each report template file with a unique document name.

    Another approach would be to wait until a device is created and then using
    its OnPageReceive event (which you will need to assign) access the
    PrinterSetup object for each TppPage object in the report as it prints. An
    example similar to this can be downloaded from the link below.

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

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