I had a PDF report working fine a bit ago and it stopped working and I think the only thing that changed was the database. One of my co-workers did a bunch of cleanup on his local version of the db, made a backup and I used that backup on my db now.
Anyway, that may or may not be the problem and I am looking for ideas.
A few important things to note about my report:
I am using a stored procedure, so I am manually making that binding happen in the code behind:
this.DataSource = null;
this.NeedDataSource += new System.EventHandler(this.My_Report_NeedDataSource);
private void My_Report_NeedDataSource(object sender, System.EventArgs e)
this.sqlConnection1.ConnectionString = ConfigurationManager.ConnectionStrings["MyDataContext"].ConnectionString;
//Transfer the ReportParameter value to the parameter of the select command
this.sqlDataAdapter1.SelectCommand.Parameters["@PersonID"].Value = this.ReportParameters["PersonId"].Value;
this.sqlDataAdapter1.SelectCommand.Parameters["@OperatorID"].Value = this.ReportParameters["OperatorId"].Value;
//Take the Telerik.Reporting.Processing.Report instance and set the adapter as it's DataSource
Report report = (Telerik.Reporting.Processing.Report)sender;
// set the table datasource as well
table1.DataSource = report.DataSource;
// get the picture paths for the person and the company logo
Also, I am creating the pdf and saving it to the file system, then opening the pdf as content in my page. Here is how I am save the pdf report to the file system:
void SaveReport(Telerik.Reporting.Report report, string fileName)
ReportProcessor reportProcessor = new ReportProcessor();
RenderingResult result = reportProcessor.RenderReport("PDF", report, null);
using (FileStream fs = new FileStream(fileName, FileMode.Create))
fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
Then, my pdf shows as embedded content in my aspx page like this:
<EMBED id="showPDF" runat="server" type="application/pdf" width="750" height="550"></EMBED>
A bit more info:
I am able to run the sproc standalone from inside sql-server management studio with no problems. Also, a pdf report does get created, but it only has header information. The detail section which has the table based on the sproc and a picture box is simply blank.
Anyway, all of this was working in the very recent past and is not working now.
Any ideas on why this is happening would be greatly appreciated!