0

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.

Community
  • 1
  • 1
JabberwockyDecompiler
  • 3,318
  • 2
  • 42
  • 54
  • If upgrading is an option, you should test with a newer version of SSRS. SSRS 2012 has much better browser compatibility than previous versions. Still some problems, so test first, but better. (iOS is supported, for example.) – Jamie F Oct 30 '13 at 21:20
  • This is a good suggestion. I did a deploy to 2008 originally (to match the client), but in the end I did 2012 because my machine had it. I still saw the same results. – JabberwockyDecompiler Oct 30 '13 at 21:47
  • 1
    Note that Chrome is not a supported browser for Reporting Services, even in 2012 version: http://technet.microsoft.com/en-us/library/ms156511.aspx#bkmk_reportmanager – Nathan Griffiths Oct 31 '13 at 04:39
  • @Nathan - That Browser Requirement site is very useful. It would have saved me a huge headache yesterday. I have just become accustomed to Chrome working in everything outside of SharePoint I was not thinking about this being MS propriety software as well. – JabberwockyDecompiler Oct 31 '13 at 14:13

1 Answers1

1

Has nothing to do with anything except that SSRS is a proprietary product of MS and MS uses a different rendering engine for IE than does browsers like Chrome(Which I prefer too), Firefox, Opera and Safari. There are two things you can do to stop the headache of doing a rendering to a different format and then presenting that:

  1. Just install the 'IE Tab' plugin to Chrome and Firefox and all the stations that want to view the reports. I generally just do this and on certain sites that need 'Active X' or some proprietary MS thing, it works great.

  2. You are going to need to change the default CSS settings on the SSRS server to get expected output tweaked. Doing this cross browser support for SSRS is a pain in my opinion but someone in StackOverflow actually wanted this answer more than number 1 for some reason and it can be done. The problem with this method is you are then everytime having a new layout kills a different browser having to code more CSS to handle it instead of just faking a different rendering engine.

I had issues with Chrome rendering certain reports for a while, now I never do. I don't even use IE with sites that say that you have to use IE anymore. Just IE Tab with Chrome ;)

djangojazz
  • 14,131
  • 10
  • 56
  • 94