Click here to Skip to main content
Rate this: bad
good
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 1:09am
manoj.jsm1.6K
Edited 7-Jan-14 20:47pm
v7
Comments
Volynsky Alex at 15-May-13 6:06am
   
What do you say about it:
http://www.codeproject.com/Articles/260470/PDF-reporting-using-ASP-NET-MVC3
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:
http://www.trirand.net/aspnetmvc/grid/exportpdf
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,
jsm
Volynsky Alex at 15-May-13 8:24am
   
Thank you, jsm!
Regards,
Alex.
Volynsky Alex at 15-May-13 10:44am
   
Well I will send, if I can find interesting information for you
Regards,
Alex
manoj.jsm at 16-May-13 3:20am
   
hi Alex,
that grate.
 
Thanks and Regards,
jsm
Volynsky Alex at 16-May-13 3:46am
   
Hi jsm,
I think it will be interesting to you:
http://www.syncfusion.com/support/forums/viewer-mvc
 
Thanks.
Regards,
Alex.
Rate this: bad
good
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:
http://mvc-tutorials.com/how-to-create-pdf-report-in-asp-net-mvc3[^]
  Permalink  
Comments
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.
 
Thanks,
jsm
Volynsky Alex at 15-May-13 8:15am
   
You're welcome manoj.jsm.
Regards,
Alex.
Rate this: bad
good
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[^].
  Permalink  
Comments
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:
http://csharp-source.net/open-source/pdf-libraries
http://www.codeproject.com/Articles/10157/Gios-PDF-NET-library
http://www.pdfsharp.net/(X(1)S(j3iwpdp5f41vcxxbfoeughut))/default.aspx?AspxAutoDetectCookieSupport=1
http://www.dotnetobject.com/Thread-Html-to-Pdf-conversion-in-asp-net-c
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 Jochen Arndt 190
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 8 Jan 2014
Copyright © CodeProject, 1999-2014
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