Skip to content

DevExpress-Examples/reporting-web-mvc-email-report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reporting for ASP.NET MVC - How to Email a Report from the Document Viewer

This example adds a custom action button to the Document Viewer that triggers a custom operation on the server side. The server-side custom operation exports a report to HTML and PDF, and emails the resulting documents.

When you run the application, you observe the Document Viewer with a newly added action button:

Document Viewer with a Custom Button to Email a Report

To email a report, click the button. The application attempts to send email to someone@test.com using the localhost SMTP server, port 25. Modify the code to apply your mail server settings.

The report sent by email is shown in the following image:

Report Sent by Email

When the user clicks the 'Send via Email' button, the client-side PerformCustomDocumentOperation method passes data to the DocumentOperationService on the server. The service exports the report to PDF and HTML formats, creates the MIME message and sends email using the MailKIt client.

The PerformCustomDocumentOperation method returns an object that implements the IDocumentOperationResult interface, so you can return the data from the DocumentOperationService to the client.

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)