cancel
Showing results for 
Search instead for 
Did you mean: 

bobj undefined + ASP .NET MVC 3 + crystalreportviewers13

Former Member
0 Kudos

Hi everyone,


My environment


I am developping a web application by using the ASP .NET MVC 3 framework.
I am using :

  • Visual Studio SP1.
  • Windows XP Professional.
  • My IIS 5.1 local.

I have installed :

  • SAP Crystal Reports 2011.
  • SAP Crystal Reports for Visual Studio 2010 by running CRforVS_13_0_1.exe.

I have got the two following virtual directories under my default web site on IIS :

  • The virtual directory corresponding to my VS2010 project.
  • aspnet_client which is the ancestor of the crystalreportviewers13 folder. The latter contains the ressources needed by a CrystalReportViewer control such as CSS and JS files.

My goal


I want to generate an HTML5 page containing a Crystal Report viewer.

I have implemented an action method in a controller.
I fill a DataTable in my action method and then I use it as a source for a ReportDocument.
Then I pass the ReportDocument to a Razor view.

I call a ViewUserControl in my Razor view and I pass the ReportDocument to the ViewUserControl.
The code of my ViewUserControl is contained in a ".ascx" file.
My ViewUserControl contains a CrystalReportViewer control.

I use the ReportDocument as a source for the CrystalReportViewer control in the Page_Init event method.

My issue


When I load my HTML5 page then I face the famous JavaScript error : "bobj is undefined".
The JavaScript error is relative to the CrystalReportViewer control.

A reference to the following JavaScript file is missing :
http://localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js

But the reference to the following CSS file is present and works :
http://localhost/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/images/style....

I do not understand why the JavaScript reference is not generated.

Does someone can help me ?
I precise that I have searched for a solution for two days and I have tried some fixes without success.

Accepted Solutions (1)

Accepted Solutions (1)

former_member188030
Active Contributor
0 Kudos

Uninstall CR for VS 2010 SP1.

Install CR for VS 2010 SP2 on top of VS 2010.

Copy the 'Crystalreportviewers' folder from

C:\Program Files\Business Objects\Common\4.0\

location and paste it to (any framework targeted)

C:\Windows\Microsoft.NET\Framework\v3.5\ASP.NETClientFiles\

C:\Windows\Microsoft.NET\Framework\v2.0\ASP.NETClientFiles\

C:\Windows\Microsoft.NET\Framework\v4.0\ASP.NETClientFiles\.

and rename it to crystalreportviewers13.

If the application is running on IIS, Copy the ASPNet_Client folder from Inetpub/wwwroot to the application directory, make sure it has crviewers13 folder

For more information see this thread.

- Bhushan.

Former Member
0 Kudos

I have uninstalled CR for VS 2010 SP1.

Then, I have installed CR for VS 2010 SP2.

The latter installation put the crystalreportviewers13 folder into :

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles

So I did not copy/paste the crystalreportviewers folder from :

C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\Crystal Reports 2011

Then I have copied/pasted the following folder under the virtual directory of my web application :

C:\inetpub\wwwroot\aspnet_client

crystalreportviewers13 is a subfolder of aspnet_client.

But I am still facing the JavaScript error : "bobj is undefined".

Then I have written the following directives into my web.config file to help ASP .NET localizing my aspnet_client folder :

  <configSections>
    <sectionGroup name="businessObjects">
      <sectionGroup name="crystalReports">
        <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"/>
      </sectionGroup>
    </sectionGroup>
  </configSections>

  <businessObjects>
    <crystalReports>
      <crystalReportViewer>
        <add key="UseBrowserLocale" value="true"/>
        <add key="resourceURI" value="~/aspnet_client/system_web/4_0_30319/crystalreportviewers13" />
      </crystalReportViewer>
    </crystalReports>
  </businessObjects>

I have learned about the above directives from the CR .NET SDK Developper Guide.

But I am still facing the JavaScript error : "bobj is undefined".

Any help would be really appreciated.

former_member188030
Active Contributor
0 Kudos

instead of

<add key="resourceURI" value="~/aspnet_client/system_web/4_0_30319/crystalreportviewers13" />

try

<add key="resourceURI" value="~/crystalreportviewers13" />

- Bhushan

Former Member
0 Kudos

I have tried to write the following directive into my web.config file :

<add key="resourceURI" value="~/crystalreportviewers13" />

instead of the following directive :

<add key="resourceURI" value="~/aspnet_client/system_web/4_0_30319/crystalreportviewers13" />

But a reference to the crv.js file is still not generated and I am still facing the JavaScript error : "bobj is undefined".

In addition the style.css file is not loaded anymore.

Answers (0)