Send report as email body
Hello
Delphi 6, RB Server 11.08
We currently provide the facility to email reports in all manner of
attachment format, using the Indy support provided with RB.
However, we now have a new requirement to actually send the report as the
BODY of the email, not as an attachment. This is essentially a mail merge,
but the letter is being emailed to the individual instead of printed.
I do not want to email someone an attachment, I would like the body of the
email to appear as the report does on screen. Can this be done and does
anyone have any experience of doing this?
Regards,
Jason Sweby.
Delphi 6, RB Server 11.08
We currently provide the facility to email reports in all manner of
attachment format, using the Indy support provided with RB.
However, we now have a new requirement to actually send the report as the
BODY of the email, not as an attachment. This is essentially a mail merge,
but the letter is being emailed to the individual instead of printed.
I do not want to email someone an attachment, I would like the body of the
email to appear as the report does on screen. Can this be done and does
anyone have any experience of doing this?
Regards,
Jason Sweby.
This discussion has been closed.
Comments
This is not a built-in feature of ReportBuilder. The Email feature is
designed to only send an attachment of a report in an exported file type.
One option would be to generate the report, then transfer the mail-merge
RichText text once it has been created to a separate Indy Message and
send it manually without using the RB Email feature.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Yes I had considered the same option, thank you very much for clarifying the
position and letting me know.
Jason.
I've been trying to implement this but am struggling to get the rich text
back out from the report.
My initial thought (the long way round) was to save the report as an RTF
file, then load it back into Delphi's TRichEdit and move forwards from
there. However, the RTF generates OK (and can be opened in Word) but Delphi
cannot seem to read the file that was generated by RB.
I have tried opening it in a Delphi form (into a TRichEdit) and back into
ReportBuilder's TppRichText component. In Delphi, this causes the error
"Richedit line insertion error". In RB, nothing happens, I just end up with
an empty ppRichText.
Instead, is there some code I can use to extract the RichText code from the
report once it has generated?
Thanks,
Jason.
Never mind, I've switched to HTML output which is easier to control and far
more suited to emails anyway.
Thanks,
Jason.