Sunday, March 4, 2018
One comments

Crystal Reports 13 ( Visual Studio 2010 ) Issue with IIS - ( bobj is undefined JavaScript Error and Crystal Report Viewer not displaying )

10:56 AM
In this article I will provide solution to the problem bobj is undefined which is a JavaScript error that occurs when you try to view the Crystal Report developed with ASP.Net, Visual Studio 2010 and Crystal Reports 13 in browser.
This issue does not occur in local but happens when you host the site on server in IIS. Actually the cause of the issue is that Crystal Report is unable to find the required JavaScript (JS) files to render the report in browser
 
Below are the steps to resolve the issue
 
1. Install proper Crystal Reports Runtime
You can refer my article on downloading and installing runtime for Crystal Reports 13 for Visual Studio 2010.
Note: First find the architecture of the hardware of your server i.e. 32 Bit or 64 Bit and based on that install appropriate runtime

Also make sure you restart the server after installing Runtime to complete and finalize the installation.
 
2. Copy the Crystal Report Support files to your Website Root Directory
Once the runtime is installed. Crystal Reports will install the required support files in the location
C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\

Crystal Reports 13 developed with Visual Studio 2012. Bobj is undefined error in IIS 7
 
Note: Here on the server the Windows installation Drive is C. It may be possible on some servers it may be something else, for example D. Thus you need to change the path accordingly.

Now you need to copy the folder from this location and place it in your website’s root directory path i.e.
C:\inetpub\wwwroot\
 
Note: If your website is a Virtual Directory or Child Application then you need to copy to the root directory Virtual Directory. As rule of thumb would be copy to the location of the Web.Config file
 
 
3. Modifications in the Web.Config File
After the above two steps you need to modify the Web.Config so that we can add a setting that will help Crystal Reports 13 find its Support JavaScript (JS) files.
 
First you need to add a <sectionin the <sectionGroupcrystalReports.
 
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"></section>
 
If you are not able to find the <sectionGroupcrystalReports, then here’s the complete section that you must have if you are using Crystal Reports 13 with Visual Studio 2010.
<configSections>
      <sectionGroup name="businessObjects">
            <sectionGroup name="crystalReports">
                  <section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null"/>
                  <section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"></section>
            </sectionGroup>
      </sectionGroup>
</configSections>
 
Next you should scroll down and look for <businessObjects> section and there you should add the following
 
<crystalReportViewer>
      <add key="ResourceUri" value="~/crystalreportviewers13"/>
</crystalReportViewer>
 
If you are not able to find the <businessObjects> section then here’s the complete section that you must have in the Web.Config file
 
<businessObjects>
      <crystalReports>
            <rptBuildProvider>
                  <add embedRptInResource="true"/>
            </rptBuildProvider>
            <crystalReportViewer>
                  <add key="ResourceUri" value="~/crystalreportviewers13"/>
            </crystalReportViewer>
      </crystalReports>
</businessObjects>
 
from aspsnippets

From blog of asp.net
first of all run the site on debug mode.
then rightclick the report viewer and goto page source.  there will be a code like this. in my case 
<script src="../aspnet_client/system_web/4_6_81/crystalreportviewers13/js/crviewer/crv.js" type="text/javascript"></script>
then goto the following derectory 
"C:\inetpub\wwwroot\aspnet_client\system_web"
check for folder '4_6_81' if there is not a folder like that create new folder
and name it.

then open a folder '4_0_30319' or '2_0_50727' then copy all content and paste it into the created folder.

not working so far copy and paste
4_6_81 into the project directory

1 comments:

Mominul said...

IMEI Checker

https://tcra.go.tz/verify-imei

 
Toggle Footer