Crystal Report Issue with IIS - ( bobj is undefined , Crystal report not displaying )
I have crystal report 2010 installed with VS 2010.i have created a crystal report which is works fine in the localhost but the issue is onc开发者_如何学JAVAe i publish my website to IIS the report is never displayed.it just display a blank page.i checked my published folder even the .rpt file is not there.can any one tell me how to resolve this issue?
Solution
The solution is to work on IIS this way:
- Copy
aspnet_client
folder fromc:\inetpub\wwwroot
folder to the new website root folder.
or (first one is easier, second one is better for maintenance)
- Create a virtual directory called
aspnet_client
that points toc:\inetpub\wwwroot\aspnet_client
inside the new website
Problem analysis
It's possible to analyze the problem
- using client tools (debug window of browser)
GET http://someserver:20080/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js 403 (Forbidden)
GET
http://someserver:20080/aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/images/style.css 403 (Forbidden)
- or server tool (IIS log , on WIN2003 is placed in
%SYSTEMROOT%\System32\LogFiles\W3SVC###\
on WIN2008C:\inetpub\logs\LogFiles\W3SVC###
).
2011-03-28 13:00:49 W3SVC701536 95.228.38.41 GET /aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/images/style.css - 20080 - 192.168.1.2 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+Trident/5.0) 403 6 64 Errore! 2011-03-28 13:00:49 W3SVC701536 95.228.38.41 GET /aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js - 20080 - 192.168.1.2 Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+Trident/5.0) 403 6 64 Errore!
Cause the problem
Crystal Reports runtime is installed, but your application is not running under default web site.
- In both cases i found that
crv.js
andstyle.css
some files were not served; - these files are placed by CR installer in
wwwroot\aspnet_client
folder, but for some reasons they cannot be reached; - In my case the reason is that i create a different website (port 20080) and aspnet_client folder is not placed inside that website
I can see that you use different versions of software and different configurations, but i think you have the same problem.
This problem was difficult for me to solve.
My Configuration is VS 2010, CR 14.0.2000.0 version, Window Server 2008 R2, IIS 7. I got the solution. I tried almost all solutions given in net. And I have implemented all tricks. Finally report displayed by commenting the below line in web.config.
<add key="ResourceUri" value="/crystalreportviewers13"></add>
Now am removing one by one which I installed and checking which are the things exactly required.
I tried all below:
- Installed CR Runtime for CRRuntime_32bit_13_0_4 and CRRuntime_64bit_13_0_4.
- Later I removed CRRuntime_32bit_13_0_4 still it works.
- Placed the aspnet_client folder inside WWWRoot folder.
- Placed the aspnet_client folder inside my application folder.
Restarted IIS when ever I did something.
The best answer for this question is here!
http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203
- You need to use Web Application Project,No Website Project because Web App will combine DLL to project also.
Copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13 (you'll got it when you install -CRforVS_redist_install_32bit_13_0.exe) To your project such as (ProjectName/crystalreportviewers13)
copy this below to your web.config
3.1
<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" />
</sectionGroup>
</sectionGroup>
</configSections>
3.2
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true" />
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13" />
</crystalReportViewer>
</crystalReports>
</businessObjects>
3.4 Publish your web application with FTP Mode to your any folder,and copy this publish to your web server then TEST it!
One, unbelievably simple reason this also occurs is that the server isn't configured correctly, meaning, static content is not enabled in Common HTTP features under server roles/Windows features.
First manually publish the rpt files into your folder on the server. If it works, then its simply a deployment issue. Try making sure the build action for the file when you click on it is "Content". Try that see if you get a bit further.
I finally got it as explained below, in old and fixed version, because on my development server I need "~" which is not the case on development server, other than that I followed the link precisely. old one :
fixed one:
Setting
<compilation debug="false">
in web.config worked for me.
Here is the solution that worked for me after hours of frustration (do these after you have made sure copying folders as recommended by others did not work..):
Scenario: CrystalReportsViewer displays a blank browser screen (no viewer or any blank reports page) View source shows the entire report content with the viewer code in there Browser may or may not display a bobj is undefined error
Test:
Browse the folder http://<server name>/aspnet_client/system_web/4_0_30319/crystalreportviewers13/images/buttonl.gif
- If you cannot see the images then that is the same issue what crystalreportsviewer faces when displaying the reports
IIS Settings to change: Expand the folders of your website in IIS (7.0 or above) Select "aspnet_client" folder Select "Authentication" in the main page (Features View) Select "Anonymous access" and Enable using the Actions menu on the right pane (this is for for testing purpose ONLY, you can disable this later) Select "Handler Mappings" on the main pane (Features view) In the "Actions" menu on the right pane Click on "Revert to Inherited" Accept to revert when prompted for confirmation
Test again: Browse the folder http:///aspnet_client/system_web/4_0_30319/crystalreportviewers13/images/buttonl.gif - if you the image that you should might as well fix your report
At least I could not find this solution documented anywhere..
Note: Do not forget to disable the Anonymous access to the aspnet_client folder in IIS if you had done it to test (like said above)
It can simply solve the problem if you copy your aspnet_client folder from C:\inetpub\wwwroot to the folder of your newly created website. For example if your website name is TestWebsite then place aspnet_client folder inside the TestWebsite folder. You do not need to make configuration changes in web.config
I know it was asked some years ago. But this method worked for me. This is for people that someday will encounter this kind of problem.
I created my application in a 32 bit environment and changed to 64 bit. I deployed my web application in IIS web server (current 64 bit) and created my own application pool (having the "manage pipeline mode" into integrated).
Then when this report issue happened, i followed those instructions from the link. I changed the "manage pipeline mode" into classic and my application worked.
A possible scenario is that the IIS Server web site is not defaulted to C:\inetpub\wwwroot as this is where by default Crystal installs it's application files in the aspnet_client\system_web\4_0_30319\crystalreportviewers13 folder.
So a possible answer is to set the website Physical Path to c:\inetpub\wwwroot
Add this reference to the crystal report javascript in your master page or page rendering the report:
<script src='<%=ResolveUrl("~/crystalreportviewers13/js/crviewer/crv.js")%>'type="text/javascript"></script>
You may visit the link below for details:
Crystal Reports Bobj is undefined and bobj.isObject is not a function in Visual Studio 2012 and 2013
In my Case I just updated SAP crystal reports Runtime Engine for .NET through Apps and features , I was using crystal report version 18 in my development server , when I deployed the App to another server ,I got this error , then I checked the version I did not get the version , only I got installed date , so I updated to last Version ... and it Worked
Add below code in aspx file where crystal report exist.
<script src="../../aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/crv.js" type="text/javascript" >
</script>
Also copy aspnet_client folder from c:\inetpub\wwwroot folder to the new website root folder.
This method solve below two issues, Now working fine
- bobj is undefined.
- Crystal report not displaying.
i know this is a bit little old post but i think the novis like me can get help from this. add this code to your web.config file and copy "crystalreportviewers13" folder from "c:\inetpub\wwwroot\aspnet_client" to your root directory
<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" />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true" />
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13" />
</crystalReportViewer>
</crystalReports>
</businessObjects>
Something else that you can do is to change the "virtual access path". After checking Chrome's console and network view I noticed that the applications wasn't reaching the js
and css
resources since this was set to the name of the web project, so set this to /
and this did the trick.
I was also facing the same issue, got it resolved. when website is hosted through IIS, then Web.config needs to have below setting :
<add key="ResourceUri" value="~/crystalreportviewers13"/>
When website through is hosted through Visual Studio then
<add key="ResourceUri" value="/crystalreportviewers13"/>
Solution is very simple just check if these folders exists .. c:\inetpun\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13\js\crviewer/
if not exists then simply make copy of the existing folder and change the last number
in my case i changed folder name to crystalreportviewers13 from crystalreportviewers14 and it started working and if you are in shared hosting copy aspnet_clients folder to your project root
to find the exact name of the folder just see the page source and search for aspnet_client
精彩评论