UPDATE: Only fails in Chrome, this is all working in IE10 and FF.
I have created an SSRS report an published it to a report server. I have a separate web application with a report viewer that looks at the report server to see the data. When I convert the server report to PDF the report shows up fine, however, this is very slow. I would like to just display the report as is, but I only see a blank page when I do this. Here is my code. I used the SsrsReportInfo class from HERE. Please let me know what I am missing.
private void OpenServerReport()
{
//Create SSRS Parameters
var reportInfo = new SsrsReportInfo("TestReport", "http://localhost/ReportServer", @"/ReportTesting2/MainReport");
//Initialize ServerReport
ReportViewer1.ServerReport.ReportPath = reportInfo.ReportPath;
ReportViewer1.ServerReport.ReportServerUrl = new Uri(reportInfo.ReportServerUrl);
if (reportInfo.Parameters != null)
{
ReportViewer1.ServerReport.SetParameters(reportInfo.Parameters);
}
ReportViewer1.ServerReport.Refresh();
//Automatically display as PDF
//var bytes = ReportViewer1.ServerReport.Render("PDF");
//Response.Buffer = true;
//Response.Clear();
//Response.ClearContent();
//Response.ClearHeaders();
//Response.ContentType = "application/pdf";
//Response.BinaryWrite(bytes);
//Response.End();
}
P.S. This is the same functionality in the report manager. When I select the report from the report manager (localhost/reports/myfolder/reportname) I see a blank page, but I can click the save button and save it to PDF and see the actual report. The report server (localhost/ReportServer/myfolder/reportname) does display the report data.