Click here to Skip to main content
15,169,069 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
I need to generate a PDF report which contains some images, costume text info and a table for my ASP.Net MVC4 application. please give me any ideas on the best way to implement this?
Updated 7-Jan-14 20:47pm
Volynsky Alex 15-May-13 6:06am
What do you say about it:
manoj.jsm 15-May-13 7:29am
hi Volynsky Alex,
It is a nice method. now i am trying this with JQgrid and if you wish take a look at this link:
what was the problem with above method is that i unable to find how to add logo and title in the header of pdf

hearty thanks my friend,
Volynsky Alex 15-May-13 8:24am
Thank you, jsm!
Volynsky Alex 15-May-13 10:44am
Well I will send, if I can find interesting information for you
manoj.jsm 16-May-13 3:20am
hi Alex,
that grate.

Thanks and Regards,
Volynsky Alex 16-May-13 3:46am
Hi jsm,
I think it will be interesting to you:


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:[^]
manoj.jsm 15-May-13 7:23am
hi Volynsky Alex,
nice description and explanation. i had to thank u for this and previous answers.

Volynsky Alex 15-May-13 8:15am
You're welcome manoj.jsm.
ibrahim fakeh 3-May-17 5:06am
the link is not working
You will need to generate you report on server side and send it as content to the client. Start here: PDF reporting using ASP.NET MVC3[^].
manoj.jsm 8-May-13 7:09am
hi Zoltán Zörgő,

i feel thankful for your reply.
iText appears to now have a strong copyleft license (AGPL). This means that i cannot use it as part of my commercial product. so plz tell me some other way to implement it
Zoltán Zörgő 8-May-13 7:42am
As I know, AGLP allows you to link to the library in commercial product, but not in a closed source one. If you make a closed source commercial product, you can buy commercial license from them. There are several open source PDF libraries out there:
But you will need to check every license agreement one by one if you want to earn money from the work of others.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900