canuckconsulting
asked on
Unable to use ReportViewer in asp.net web forms application
I have installed the ReportViewer version 11 download and am struggling to get it to work at all in Visual Studio 2013.
I created an empty web ASP.Net Web application and add a webform. To this aspx I drag from the toolbox a ScriptManager control as well as a ReportViewer control. Doing this adds the following line at the top of the file:
I check references and see that Microsoft.ReportViewer.Web Forms exists and is of version 11.
Finally here is my updated Web.config:
Running the project gives the following error:
I created an empty web ASP.Net Web application and add a webform. To this aspx I drag from the toolbox a ScriptManager control as well as a ReportViewer control. Doing this adds the following line at the top of the file:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
I check references and see that Microsoft.ReportViewer.Web
Finally here is my updated Web.config:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<httpHandlers>
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
</httpHandlers>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>
Running the project gives the following error:
0x800a1391 - JavaScript runtime error: 'Microsoft' is undefined
ASKER
What line are you getting this error from?
ASKER
I am so sorry for the late reply!
I get the error from here from the line beginning "$create(Microsoft.Reporti ng.WebForm sClient":
The error I receive is:
I get the error from here from the line beginning "$create(Microsoft.Reporti
<script type="text/javascript">
//<![CDATA[
Sys.Application.add_init(function() {
if (typeof Microsoft == 'undefined' ||
typeof Microsoft.Reporting == 'undefined' ||
typeof Microsoft.Reporting.WebFormsClient == 'undefined' ||
typeof Microsoft.Reporting.WebFormsClient.ReportViewer == 'undefined')
Sys.UI.DomElement.setVisible($get('ctl00_ContentPlaceHolder1_ReportViewer1_HttpHandlerMissingErrorMessage'), true);
$create(Microsoft.Reporting.WebFormsClient.ReportViewer, {"_internalViewerId":"ctl00_ContentPlaceHolder1_ReportViewer1_ctl03","id":"ctl00_ContentPlaceHolder1_ReportViewer1"}, null, null);
});
The error I receive is:
Please give me time to retrace my own solution.
I had EXACTLY the same problem two or three months ago but I can't remember how I resolved it.
I will be once I remember.
I had EXACTLY the same problem two or three months ago but I can't remember how I resolved it.
I will be once I remember.
ASKER
I'd be very grateful if you can help1 My deadline is rapidly approaching and I have no idea how I'm going to get this sorted.
Thanks,
Scott
Thanks,
Scott
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much for the link.
Unfortunately those tips have not done the trick for me. I 'm really stuck on this as I can't get this control to work on either my Windows 8 laptop running Visual Studio 2013 nor my w7 machine running Visual Studio 2012.
Could I trouble someone to download the project I uploaded and see if it works on another environment? Or alternatively build the smallest asp.net solution with the report viewer in a page and upload it so I can see if it works on my system?
Many thanks,
Unfortunately those tips have not done the trick for me. I 'm really stuck on this as I can't get this control to work on either my Windows 8 laptop running Visual Studio 2013 nor my w7 machine running Visual Studio 2012.
Could I trouble someone to download the project I uploaded and see if it works on another environment? Or alternatively build the smallest asp.net solution with the report viewer in a page and upload it so I can see if it works on my system?
Many thanks,
ASKER
Once I added the following worked great. Thank you for your help!
<system.webServer>
<validation validateIntegratedModeConf iguration= "false" />
<handlers>
<add name="ReportViewerWebContr olHandler" preCondition="integratedMo de" verb="*" path="Reserved.ReportViewe rWebContro l.axd" type="Microsoft.Reporting. WebForms.H ttpHandler , Microsoft.ReportViewer.Web Forms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd808 0cc91" />
</handlers>
</system.webServer>
<system.webServer>
<validation validateIntegratedModeConf
<handlers>
<add name="ReportViewerWebContr
</handlers>
</system.webServer>
Typical steps are:
1. Add a page.
2. Open the Toolbox window. From the AJAX Extensions group, drag a ScriptManager control onto the design surface.
3. From the Toolbox window, in the Reporting group, drag a ReportViewer control onto the page below the ScriptManager control.