Crystal Report Issue with IIS - ( bobj is undefined , Crystal report not displaying )
Asked Answered
B

19

21

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 once 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?

Banebrudge answered 1/9, 2011 at 4:13 Comment(0)
L
41

Solution

The solution is to work on IIS this way:

  • Copy aspnet_client folder from c:\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 to c:\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 WIN2008 C:\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 and style.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.

Lotz answered 21/2, 2013 at 16:32 Comment(4)
Thanks so much for this. Took me forever to get fixed before I found your answer. It is indeed the issue where I used an additional web application as opposed to the default web application.Foreleg
I have installed Crystal report, and I am using it on some desktop application. Now I am trying to implement it in asp mvc. The problem is that I do not have the c:\inetpub\wwwroot folder. I have also searched my computer for aspnet_client folder and it does not exit. What should I do?Dispossess
I have found the folder aspnet client on some example project and just copy pasted it and it worked!Dispossess
Correct... The IIS wwwroot must be copyed to new IIS folderDoty
U
4

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.

Unweighed answered 22/7, 2012 at 9:42 Comment(4)
"Placed the aspnet_client folder inside my application folder" is enough to solve the 'bobj' problem!Lotz
I have installed Crystal report, and I am using it on some desktop application. Now I am trying to implement it in asp mvc. The problem is that I do not have the c:\inetpub\wwwroot folder. I have also searched my computer for aspnet_client folder and it does not exit. What should I do?Dispossess
I have found the folder aspnet client on some example project and just copy pasted it and it worked!Dispossess
@Unweighed This worked for me on the server, thank you very muchUproot
S
3

The best answer for this question is here!

http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203

  1. You need to use Web Application Project,No Website Project because Web App will combine DLL to project also.
  2. 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)

  3. 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!

Sewerage answered 20/1, 2013 at 21:6 Comment(2)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewMammillate
To Down vote is really necessary? In the link I provided there is the answer, ok, I should insert parts of the answer here, but my answer still answering the question.Sewerage
A
1

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.

Enabling Static content

Aristocracy answered 3/3, 2016 at 17:0 Comment(0)
K
0

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.

Kassandrakassaraba answered 1/9, 2011 at 5:57 Comment(0)
E
0

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:

Eurhythmy answered 29/9, 2011 at 18:41 Comment(0)
C
0

Setting

<compilation debug="false">

in web.config worked for me.

Centigrade answered 20/8, 2013 at 7:43 Comment(0)
D
0

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)

Disastrous answered 3/10, 2013 at 13:37 Comment(0)
V
0

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

Velvetvelveteen answered 7/12, 2013 at 18:34 Comment(0)
S
0

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.

Spadix answered 5/2, 2014 at 9:57 Comment(0)
T
0

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

Transferase answered 4/5, 2017 at 1:1 Comment(1)
Welcome to SO! This looks like a comment to the question instead of an answer. If you intend to comment, you need to have sufficient reputation to comment on any post. Also check this what can I do instead.Breakwater
P
0

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

Poniard answered 22/5, 2017 at 5:32 Comment(0)
U
0

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

Undesigning answered 19/8, 2017 at 16:44 Comment(2)
Updated the engine to what? A newer version? How do you check the runtime engine? What do we check for?Edgy
Go to Apps and features , you can check version from there , 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 , It was like 3 months before version 18 released , so I updated to last Version ... and it Worked.Undesigning
T
0

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

  1. bobj is undefined.
  2. Crystal report not displaying.
Tracay answered 30/8, 2017 at 10:46 Comment(0)
B
0

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>
Baldheaded answered 27/11, 2017 at 12:23 Comment(0)
A
0

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.

Apostrophe answered 22/12, 2017 at 18:24 Comment(0)
C
0

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"/>
Cankerworm answered 22/7, 2018 at 9:12 Comment(0)
M
-1

​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

Macmahon answered 23/8, 2021 at 16:52 Comment(0)
L
-1

just in case anybody comes across this I had a 2008r2 server that was patched(by others) I found the IIS webpage looking for a later directory for .net 4 crystalreport runtime . when i checked debug on webpage - orig asp_client crystal reports dotnet directory folder was different version - I jut renamed directory in asp_client folder to match- no other changes. Hope it helps someone!!!

Laurenlaurena answered 16/2, 2024 at 21:45 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.