views:

672

answers:

2

I don't have grid view as I am working on asp.net MVC.

So can I create Response object which writes data into pdf format

Response.AddHeader("Content-Disposition", "attachment; filename=data.pdf");
Response.ContentType = "application/.pdf";

I use these two lines but I don't know in which format, I should write data?

A: 

LOL.

You need to get PDF converter to convert from whichever format you use to PDF. The last I checked there were no fully functional converters for free. Buy it, buddy.

User
+1  A: 

you must use a pdf library like iTextSharp. just do a google search. I usually generate my pdf reports on the fly using report viewer control (client-side mode).

Andrea Balducci
http://www.ujihara.jp/iTextdotNET/en/examples.htmlhere are the good examples + .dll file for com.lowagie.text package.
Vikas