Home Devices

email

edited December 2009 in Devices
We are using Delphi 2009 and report builder 11.06 when we preview a report
and click the email button and we get a blank page and no email is
generated, any ideas ?

Comments

  • edited December 2009
    Hi Simon,

    There is a patch that fixes the blank page issue. Contact
    support@digital-metaphors.com to receive the patch. Take a look at the
    article for a possible solution to "no email is generated".

    http://www.digital-metaphors.com/rbWiki/Output/Email/Troubleshooting..._Cannot_Preview_Email

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited December 2009
    Thanks for the update I will get the patch for the blank page but the Email
    problem does not seem to the the issue in the link it simply does nothing no
    error just a blank page. I am clicking the email button from the preview
    screen.

  • edited December 2009
    Hi Simon,

    Are you using the MAPI plugin with Outlook? If so, do you have Outlook open
    when you click the email button? If so, try closing Outlook (or any other
    email client) and then try sending the email again. By default
    ReportBuilder suppresses all email errors. See the following article on how
    to expose these errors to possibly get some clues on what is happening.

    http://www.digital-metaphors.com/rbWiki/Output/Email/How_To...Show_Email_Errors

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2010
    Sorry to hijack this one, though I am Simon's colleague, not just some
    random!

    The error appears to be that it can't find the PDF file to attach to the
    email. What we're currently doing is:

    Saving the report to disk as .spl
    Loading that into a ppArchiveReader (ppArchiveReader.ArchiveFileName =
    .spl)
    ppArchiveReader.DeviceType = Screen
    ppArchiveReader.Print

    This then brings up the preview form. Clicking 'Email' gives a delphi
    exception that it can't find the file to attach. It appears to be looking
    in:

    c:\Documents and Settings\\LocalLow\Temp\Report.pdf

    Which is, as far as I can tell, not something we're setting.

    The user gets no error message, the only error is the exception in Delphi
    (FileNotFound).

    So I suppose the question is: does SendMail create the PDF to be attached in
    a particular place and if so, how do we change where that location is?

    Thanks,

    Steve Branley

  • edited June 2010
    Hi Stephen,


    Yes, you can use the Report.EmailSettings.FileName property to determine
    where the emailed file will be saved. If this property is left blank, the
    file is saved in the default temp location for Windows.

    See the TppEmailSettings topic in the RBuilder help for more information.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2010
    Thanks Nico, but that's not working. If I set
    ppArchiveReader.EmailSettings.FileName it simply complains that it can't
    find the file with that name when the user presses the email button. It
    looks like it's not creating a physical copy of the file. Is that because
    that's something that has to be done manually? Do we have to manually create
    the PDF before the call to SendEmail? I was under the impression that
    SendEmail would create the PDF itself and then attach it to the email
    automatically.

    Thanks,

    Steve

  • edited June 2010
    Sorry to reply to myself, but I think this is a bug in ReportBuilder. I've
    just traced through the code and in ppEmail.pas, ProcessAndSend() the
    following code is run:

    if not(lFileDevice = nil) then
    begin

    ProcessFileName(FReport, lFileDevice);

    FReport.TextFileName := FReport.EmailSettings.FileName;
    // FReport.Initialized is TRUE here
    FReport.ArchiveFileName := FReport.EmailSettings.FileName;
    // FReport.Initialized is FALSE here

    { export report to file }
    if (FReport.Initialized) then
    FReport.PrintWithSameParameters
    else
    FReport.Print;
    end

    At the start of that block FReport.Initialized is TRUE, then as soon as
    FReport.AchiveFileName is set FReport.Initialized is set to FALSE and
    instead of PrintWithSameParameters being run, Print is run which seems not
    to export the file. If I remove the setting of the FReport.ArchiveFileName
    property then the email routine works as expected.
    ppProd's SetArchiveFileName includes a call to 'reset() and it's this that
    sets the Initialized property back to false.

    The line FReport.ArchiveFileName := FReport.EmailSettings.FileName; is new
    in RB12 (I checked against 11.06 so it might be a later version of 11 that
    introduced it) and in fact sending email did work for us before we upgraded
    to RB12.

    Thanks,

    Steve

  • edited June 2010
    Hi Stephen,

    Thanks for pointing this out. I created a patch that solves the issue.
    Contact support@digital-metaphors.com if you would like the patch.

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