Posts Tagged ‘report viewer’

MS Reporting Services Report Viewer Control printing errors with IE8 and Vista

May 29th, 2009

We use SQL Server 2008′s Reporting Services for all of our site’s reports here at work.  Along with that we also use Microsoft’s Report Viewer control which gives you the ability to serve up the RDL files that are stored in SQL Server.  One of the features that the control offers is the ability to print your reports.  To accomplsih this it uses Active-X, which we all know can be funky and a hassle to troubleshoot when it’s not working properly.

When we released our new system back in February we got most of our users printing with minimal support.  We encouraged all of them to upgrade to IE 7 (many were still using IE6) which did fine with the control.  Shortly after our launch Microsoft started rolling out IE8 and our users slowly started upgrading.

That’s when we found many of them having issues printing.  As you’ll see in this screen shot, they would simply get a generic error when clicking the print button, even after successfully installing the print control.  As a work around we were having folks export to PDF and then print from there.  Obviously this wasn’t an ideal solution and we started troubleshooting to figure out what the problem was.

rs-report-error

After doing some testing on our end on virtual machines we were able to reproduce the problem and narrowed it down to Windows Vista running IE8.  Since we weren’t able to resolve the problem on our virtual machine configuration with anything we tried we eventually opened a support ticket with Microsoft.

After some support calls with Microsoft they informed us that in order for this to work properly you have to add the site that’s using the report viewer control as a trusted site if you’re using Internet Explorer 8 and Windows Vista. We thought this was odd because we definitely had tried this on our virtual machine setup and didn’t have any luck.

What we found out on our own later was that as that this solution does not seem to help if you originally started out with a Beta or RC (Release Candidate) copy of IE8 that had been upgraded to the final release.  That was the scenario we had on our virtual machine that we were using to test IE8 and even the trusted site fix didn’t help in that scenario.

So, if you are having this problem and you’re using a clean install of IE8 or an upgrade to the final release of IE8 from a previous version adding the trusted site to fix this problem is easy.

Just open up IE and click Tools > Internet Options and follow the steps shown here in the screen shot to add your site as a trusted site:

trusted-sites

Restart your browser and you’re in business.

Now if they could only get away from Active-X so our users that decide not to use IE can print.

JavaScript Reporting Services ReportViewer control error fix

December 8th, 2008

I have been going back and forth banging my head against a wall trying to fix a JavaScript error that was happening on my Reporting Services ReportViewer control when the View Report button is clicked.  The error was a JavaScript error and seemed to be related to using something AJAX related on the same page as the ReportViewer control, but it took me a while to figure out what it was and fix it.  All of the problems I saw on the web related to using either an AJAX update panel or one of the extenders in the AJAX Control Toolkit.  Unfortunately for me I wasn’t using either one of them so trying to figure this one out was tricky.

The specific JavaScript error was:

Microsoft JScript runtime error: ‘this._postBackSettings.async’ is null or not an object

My page was setup where I had a master page with an AJAX menu on it (Radmenu to be specific).  In order to use the Radmenu you need a ScriptManager object.  Other than the menu, I didn’t have any AJAX related controls on either the master page or the content page.

What I eventually figured out was that my report pages (which use a base class) needed to disable partial rendering.  To do this, you must do it in your page’s init event.  If you do it after the init you’ll get an invalid operation exception.  Here’s the code in the base class (you can put this in your code behind if you’re not using a base class):

    Private Sub Page_Init1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
 
        ' Make sure this page has a master page
        If Not IsNothing(Me.Master) Then
 
            Dim masterScriptManager As ScriptManager
            masterScriptManager = CType(Master.FindControl("MasterScriptManager"), ScriptManager)
 
            ' Make sure our master page has the script manager we're looking for
            If Not IsNothing(masterScriptManager) Then
 
                ' Turn off partial page postbacks for this page
                masterScriptManager.EnablePartialRendering = False
            End If
 
        End If
 
    End Sub

Just in case others stumble across this and are trying to solve their problem, here are some of the links I landed on when trying to solve the problem: