1
votes

I am developping a web application by using the ASP .NET MVC 3 framework.
I have implemented a Razor view which contains a call to the Html.Partial method.
The call to the Html.Partial method is used to execute a ViewUserControl - A file with ".ascx" extension.
I have included a Crystal Reports viewer in the ViewUserControl.

Prior to the above operations I have installed SAP Crystal Reports 2011 on my computer.
Then I have installed SAP Crystal Reports for Visual Studio 2010 by running CRforVS_13_0_1.exe.

But I am facing a JavaScript error during the execution of my ViewUserControl : "bobj is undefined".
I have googled some help before writing this post but with no success.
I even tried the step-by-step procedure described in this web page : http://social.msdn.microsoft.com/Forums/en-CA/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203

I have checked the presence of viewers' virtual directories as advised in the SAP Crystal Reports .Net SDK Developper Guide.
The following directories are present in my file system and they contain files so there is no problem according to the developper guide :

  • C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13
  • C:\inetpub\wwwroot\aspnet_client\system_web\2_0_50727\crystalreportviewers13
  • C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles\crystalreportviewers13
  • C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles\crystalreportviewers13
1
Try moving the entire aspnet_client folder into your project's root directory.CheckRaise
I tried it but I am still getting my error. Do I have to write directives into my Web.config file in addition to copying the aspnet_client folder ?user1139666

1 Answers

0
votes

The CrystalReportViewer needs "CrystalReportViewer1.RefreshReport()" to be called somewhere. Without this line, you will get a bobj javascript error. Put that line before you set your parameters if you do not want a parameter value popup to appear to the user, otherwise, call it after you set your parameters.