1

We had a MS ReportViewer 9.0.0.0 control on a custom DotNetNuke module in the (legacy) 4.8.2 version. While trying to upgrade to 10.0.0.0 we run into the following error:

PageLoadException: Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.

Here's the relevant ASCX code for the main View control in the DotNetNuke module:

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, 
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<rsweb:ReportViewer ID="report" runat="server" ProcessingMode="Remote" />

Additionally, there's some code behind that sets the IReportServerCredentials, I've left out that bit of code as the problem occurs before the report's even rendered.

The stack trace is quite large, but here are some of the relevant bits:

DotNetNuke.Services.Exceptions.PageLoadException
System.InvalidOperationException: Page cannot be null
at System.Web.UI.ScriptManager.get_IPage()
...
at Microsoft.Reporting.WebForms.ReportViewer.Render(HtmlTextWriter writer)
...
at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer)

My Google-fu is not helping me at all. I've tried fiddling with the ScriptManager in DotnetNuke's Default.aspx.vb file, playing around with the properties of the ReportViewer control, and reading the various related MSDN articles. No dice.

The question: How to get ReportViewer 10.0.0.0 working in DotNetNuke 4.8.x?

4

1 に答える 1

1

This is one of the few questions I've had lately which couldn't be answered by searching on SO. After some more fiddling around I've solved the problem and figured I'd give the new Answer your own question feature a spin. So here's what solved the problem for me.


This problem can be solved by enabling the DotNetNuke AJAX implementation for the specific control in your module that holds the ReportViewer. Credits go to this old post detailing the steps to get this working. See also the 2007 DotNetNuke blogpost on this feature. The essence is as follows:

  1. Log in as DNN Host
  2. Go to the module definition for your module
  3. Edit the settings for the module
  4. Find the control with the ReportViewer
  5. Click to edit the settings for the control
  6. Hit the Supports Partial Rendering setting checkbox
  7. Save the settings

The ReportViewer control should now work.

于 2012-06-12T13:29:21.930 に答える