This is a migrated thread and some comments may be shown as answers.

Sending a Telerik Report in an email as embedded HTML/MHTML

3 Answers 144 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 06 Jun 2014, 04:44 PM
I have been reading the following thread:

http://www.telerik.com/forums/mhtml-export-in-e-mail-body

It appears to suggest that sending a Telerik report as embedded HTML/MHTML within the body of an email (using .NET) may be possible, however there is not a full code sample for this and it is suggested it may be tricky to do.

Is this possible with the current version of reporting "Q1 2014 SP1"? Can you supply a full code sample of how to generated the necessary files, and how to link to an email using MailMessage in .NET?

Thanks

Ian

3 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 11 Jun 2014, 08:46 AM
Hello Ian,

The recommended approach for sending a report in e-mail is to add it as an attachment. Please consider the example in the Send Telerik Report as email attachment code library project.

You can test the approach described by my colleague in the mentioned by you forum thread: MHTML export in e-mail body. More details about exporting programmatically a report are available also in the Exporting Report Programmatically article (Exporting a report to a multi document format:).

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ian
Top achievements
Rank 1
answered on 11 Jun 2014, 04:18 PM
Hello Stef,

Thanks for the reply. I am aware that we can send a report as an attachment. This is easy, well documented and is our current approach. However we would like to send the report as HTML format in an email body if at all possible.

The post that you and I refer to simply gives details of how to export a report to a series of files. Please can you supply a full sample of how I can embed an Telerik report in an email body using .NET MailMessage class? It is not at all clear to me of how to achieve this from any posts I have seen on sites such as Stackoverflow.

This functionality is a high priority for our project - but we do not have the resources or time to spend time experimenting with approaches.

Thank you for your help

Ian

0
Stef
Telerik team
answered on 16 Jun 2014, 03:24 PM
Hi Ian,

Each e-mail application has its own restrictions and limitations for the content of e-mails. Thus the recommended approach is to export the report into proper format and attach it to the e-mail.

You can still test to export the report programmatically into HTML5Interactive format (which will produce as many pages as seen in Interactive preview), and set in the deviceInfo to export only the content of the report - ContentOnly setting. Before placing the HTML into the message, you can modify the content to make it compatible with Outlook (check the limitations listed at the end of the linked article).

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Ian
Top achievements
Rank 1
Answers by
Stef
Telerik team
Ian
Top achievements
Rank 1
Share this question
or