Click here to Skip to main content
11,805,266 members (56,132 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0 C# ASP.NET Javascript C#4.0 , +
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?
Posted 8-May-13 0:09am
Edited 7-Jan-14 19:47pm
Volynsky Alex at 15-May-13 6:06am
What do you say about it:
manoj.jsm at 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 at 15-May-13 8:24am
Thank you, jsm!
Volynsky Alex at 15-May-13 10:44am
Well I will send, if I can find interesting information for you
manoj.jsm at 16-May-13 3:20am
hi Alex,
that grate.

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

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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

Volynsky Alex at 15-May-13 8:15am
You're welcome manoj.jsm.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 at 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ő at 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)

  Print Answers RSS
0 OriginalGriff 315
1 Richard Deeming 200
2 Sergey Alexandrovich Kryukov 170
3 CPallini 160
4 CHill60 150
0 OriginalGriff 3,255
1 Maciej Los 1,990
2 KrunalRohit 1,907
3 CPallini 1,855
4 Richard MacCutchan 1,227

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 8 Jan 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100