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

Mailing a report

edited June 2004 in End User
Hello again

Is there any way to write a code in calc section so that when I opens
(whitout preview) a report, it save it as a rtf file with the name from a
textfield in the report + .rtf and after that opens outlook and attach the
actual report as a rtf file?

/Stig

Comments

  • edited June 2004

    I think what want you to do is press the Print button from the Report
    Explorer and then use the Print dialog to print the report to .rtf and email
    it.

    There are some add-on products for ReportBuilder that add additional export
    formats to ReportBiulder and some of them provide email capability as well.

    You might consider other formats such as PDF for emailing as well. The PDF
    format will preserve the fidelity of the report layout much better than
    .rtf.

    You will also need to have Report.AllowPrintToFile set to true for your
    reports.

    Here is an article on emailing reports...

    ------------------------------
    Tech Tip: E-Mailing Reports
    ------------------------------


    Format
    ------

    First decide what format you would like to use: PDF. Text, RTF, HTML, or
    Archive. PDF is probably the most flexible because it can support complex
    formatting, can printed to the printer, and most users have the acrobat
    reader installed onto their computer already.

    For PDF, RTF, or HTML you need to use a ReportBuilder add-on product such as

    1. TExtraDevices: www.waler.com or

    2. PsRBExportDevices: http://www.pragnaan.com

    3. Gnostice eDocEngine: http://www.gnostice.com


    For Archive, you would need to distribute a small .exe that contains the
    ReportBuilder ArchiveReader component.

    For Text you usually have to create the layout in Courier New or some Fixed
    Width font and carefully position the objects so that they can be mapped to
    the 1/6 inch lines (11 inch page / 66 lines).



    Transmittal
    -----------

    The PsRBExportDevices and Gnostice eDocEngine products mentioned above have
    built-in e-mail capability.

    Most internet component packs contain an SMTP component that can be used to
    easily send e-mail. The Indy components that are included with Delphi are
    one option. The products contain demos of how to send e-mail. There are
    probably other alternatives out there....


    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com


    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited June 2004
    Hello Nard
    Thanks for your answer..
    Some clarification:

    Its a helpdesk that uses a program for register Industry complaints
    and they want to send a complaint confirm to the customer true email.
    That's why they don't need to see the report, and they think that it?s a
    lot of work to first look at the report covert, save, create new mail,
    attach? the saved file and send. So what I need is an automation of this
    procedure. And I was thinking that on the event open report could do this
    tasks, and for the helpdesk personal just get outlook opened whit this
    complaint attached to a new mail.

  • edited June 2004

    As an example open the RBuilder\Demos\EndUser\ReportExplorer\EndUser.dpr
    project. Make the following modifications.

    1. Modifiy the LoadEndEvent method to look this

    procedure TmyEndUserSolution.LoadEndEvent(Sender: TObject);
    begin
    ppReport1.OnPreviewFormCreate := PreviewFormCreateEvent;
    ppReport1.OnPrintDialogCreate := PrintDialogCreateEvent;
    end;

    2. Add a PrintDialogCreateEvent method that looks like this

    procedure TmyEndUserSolution.PrintDialogCreateEvent(Sender: TObject);
    begin

    ppReport1.PrintDialog.AllowPrintToFile := True;
    ppReport1.PrintDialog.TextFileName := 'c:\myReport.txt';
    ppReport1.PrintDialog.DeviceType := dtReportTextFile;

    end;

    3. Run the project, select a report and press the Print button from the
    Report Explorer. The print dialog will be displayed and will default to
    print the report to a text file.

    4. Now if add one of the RB add-on devices that supports emailing, I think
    you will have a solution. Or perhaps I do not understand.




    --

    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.