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

Send Report as Attach via eMail

edited October 2004 in Devices
I'm trying to create a new "Send Report Via eMail" checkbox (similar to
Print to File) in the RB Print Dialog screen (ppPDlg.pas), so when the
user check this option and press OK, the TExtraDevices Mail Dialog screen is
dispayed with the report alredy attached in the specified format.

Is this possible ??? What is the correct procedure to modify the RB Source
Code ??? Is there any writting document about this procedure ???
I received an Error Message compiling ppPDlg.pas : Internal Error U16 -
(referred to file ppFilDev).

Any suggestions are welcome, the idea is generate a report in an specified
format (using TExtraDevices) and attach it to an eMail, which can be
edited by the users using the eMail Dialog screen.

Thank you,
Jorge

Comments

  • edited October 2004
    Hi Jorge,

    Rather than change the ReportBuilder source, you will want to simply
    register a new dialog.

    ------------------------------------------------------------
    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 preview dialog you could

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

    The default dialog resides in RBuilder\Source\ppPrvDlg.pas and the form is
    called ppPreviewDialog. You should assign your form a unique name, for
    example, myPreviewDlg, 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 preview dialog inherits from an ancestor
    TppCustomPreviewDialog - 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(TppCustomPreviewer, TmyPreviewDlg);


    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 October 2004
    Hello Nico,

    I'm going to try this idea, it looks more reasonable.
    Could you please tell me where are stored the Tech-Tips ?
    Is there a document with all this information we can download ?

    Thanks a lot,
    Jorge


  • edited October 2004
    Sorry Nico, but this Tech Tip is really confusing me, I've trying different
    ways with no results.
    I think this document needs to be overhauled.

    Thanks,
    Jorge

    form
    new

    This point means rename the file using the Windows Explorer, right ?
    Where do you have to do a SaveAs under other unit name ?

    preview

    There is NO form called ppPreviewDialog.dfm in RB-Enterprise 7.04
    I assume is ppPrvDlg.dfm, is that correct ?

    is

    It means I have to open the form in Delphi and save it under other name ?

    where


    My form does not inherit from TppCustomPreviewDialog.
    The class definition is
    TppPrintPreview = class(TppCustomPreviewer)

    TppCustomPreviewDialog
    forms for ReportBuilder are defined).

    Where do I have to register the new form, which unit ?

    ReportBuilder.
    created this
    OnClick event of the button.
  • edited October 2004
    Hi Jorge,

    I apoligise about the tech tip, it does need to be updated. However the
    concepts described about replacing a dialog in RB are still sound. Below is
    a link to an example that creates a custom Print Dialog and registers it
    with ReportBuilder. This should get you on the right track.

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

    Note: All the Tech Tips articles can be found in the Tech-Tips newsgroup.

    news://news.digital-metaphors.com/digital-metaphors.public.reportbuilder.tech-tips

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