This is a migrated thread and some comments may be shown as answers.

ReportViewer error in MVC Project

2 Answers 159 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ranjit
Top achievements
Rank 1
Ranjit asked on 01 Oct 2012, 08:39 PM
Hello,

Currently we are attempting to use the Web Report Viewer in our MVC4 project, and have run into some issues running on the IE9 Browser. When using Chrome or another browser, the viewer renders the report with no issues. Currently the aspx partial view that holds the viewer is being served up by a regular MVC controller.

Here is the error I receive when running the viewer in IE:

Unhandled exception at line 561, column 13 in script block
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'ErrorMessage': object is null or undefined

I've searched extensively for a solution to this issue with no luck... someone from the Telerik team please help!

I've also put my code snippets below:

this is coming from the ReportViewer javascript code, where it makes the function call and contentWindow is null:
ReportViewer.prototype.GetError = function ()
{
var paramsArea = document.getElementById(this.paramsFrameID);
var msg = "";
if (paramsArea){ msg = paramsArea.contentWindow.ErrorMessage; }
if (!msg) { var reportFrame = document.getElementById(this.reportFrameID);
if (reportFrame) { msg = reportFrame.contentWindow.ErrorMessage; }
return this.LocalizeMessage(msg);
}

Here is the code for my ReportViewer.aspx:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Register Assembly=
"Telerik.ReportViewer.WebForms, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<%@ Register Assembly=
"Telerik.Reporting, Version=6.1.12.820, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.Reporting" TagPrefix="telerik" %><br><%@ Import Namespace="System.Web.Mvc" %>
<%@ Import Namespace=
"System.Data" %>
<head runat=
"server">
   <title></title>
</head>  

<form id=
"main" runat="server" method="post" action="#">
   <telerik:ReportViewer ID=
"ReportViewer1" runat="server" style="width: 790px; height: 800px;" >
   </telerik:ReportViewer>
</form>
<script runat="server">
 public override void VerifyRenderingInServerForm(Control control)
 {
   //base.VerifyRenderingInServerForm(control);
   // to avoid the server form (<form id="Form2" runat="server">) requirement
 }

 protected override void OnLoad(EventArgs e)
 {
    base.OnLoad(e);
    ReportViewer1.ReportSource = new QuoteRpt();
    var name = "QuoteReport"
    ReportViewer1.ReportSource.Parameters.Add(new Telerik.Reporting.Parameter("QuoteId", ViewBag.QuoteID));
 }
</script>

2 Answers, 1 is accepted

Sort by
0
IvanY
Telerik team
answered on 04 Oct 2012, 04:38 PM
Hello Ranjit,

It will be best if you are able to send us a runnable sample that exhibits the issue so that we are able to reproduce it at our end - that way we will be able to identify the culprit faster and advise you more accordingly. In general there is nothing wrong with the code snippet you have sent us, but other parts of your application may cause the issue as we are not able to reproduce it locally.

You can also check with a tool like Fiddler to see if all the resources needed for the proper work of the Report Viewer get to the client.

Regards,
IvanY
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Ranjit
Top achievements
Rank 1
answered on 26 Oct 2012, 04:20 PM
Ivan, I will submit a support ticket since this forum doesn't allow me to upload a .zip file.

I have a working stand alone project that has reproduced the error.

I have at least narrowed it down to a conflict between Microsoft Ajax Map control (The pins being pushed to the map.entities) and the ReportViewer. If that sheds any light that could help identify the problem I'm all ears.
Tags
General Discussions
Asked by
Ranjit
Top achievements
Rank 1
Answers by
IvanY
Telerik team
Ranjit
Top achievements
Rank 1
Share this question
or