Follow these steps to generate an actual report from your web application:
* Create a controller that derives from PdfViewController.
* Create a view that generates the HTML which should be translated to a PDF report.
* Create an action on a controller which calls the ViewPDF method on the PdfViewController.
* Create a link to trigger the action on the controller.
* Below, these steps are described in more detail.
Create a view that should be translated to a report. This could be an existing view or a new view specially for reporting. I usually create a new view as it lets me control the HTML markup for the report. As stated earlier, the report generator does not support all the HTML markup. In the demo project, this is the PrintDemo view.
Below, the PrintDemo view from the demo project is shown. As can be seen, this is just a simple ASP.NET Razor view with a table and some rows. It uses a strongly typed model but that is not necessary. A tip when trying to design your report is to add borders to your table or div. Using these borders, when looking at the generated PDF, you can clearly see the start and end of the areas of your report
For more information,you can read the following post:
http://mvc-tutorials.com/how-to-create-pdf-report-in-asp-net-mvc3[
^]