I\'ve got an ASP.NET web page that is a dynamically generated report. For business reasons, this exact report needs to be produced as a PDF. What\'s the best way to do this?
Have you looked at SQL Server Reporting Services? If you are using MSSQL 2005/2008 then you probably already have reporting services and you just need to configure it. You can host your reports there and in just a few lines of code get the report as a PDF file.
//create the web request for the report based on a URL that will define export
//format, parameter values, etc.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(reportUrl);
//send creditials if necessary
request.Credentials = new NetworkCredential(userName, password);
//response will contain the PDF file as a stream
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Here is a link that might help as well