Report appears blank in browser after deploying a Crystal Reports.NET web application.
Recently I have seen many of these issues being reported on the forum and support incidents as well. Almost all the possible causes have already been discussed on forums threads and knowledge base articles. This article summarizes them all.
Consider following scenario:
A Crystal Reports web application to view report in the web viewer, works fine from Visual Studio but when the application is deployed on IIS the reports appear blank.
Crystal Reports version could be CR 2008, CR for VS 2010 with corresponding Visual Studio version.
The first thing to do is to develop and deploy a sample application and see if it reproduces the issue.
Follow the proper deployment procedure mentioned in the Crystal Reports.NET SDK Developer guide.
A sample application eliminates the complexities of the actual application which may be an entire project.
A sample is available here: https://smpdl.sap-ag.de/~sapidp/012002523100006252712008E/csharp_web_smpl.exe
Possible causes and solutions to the Issue:
- Compatibility Check:
Use only those versions of IIS and the browser which are supported by the respective version of Crystal Reports used.
Take a look at the Supported Platforms documentation:
- Upgrade Crystal Reports runtimes.
Uninstall previously installed CR runtimes, download and install the latest CR runtimes on the web server.
- Do not bind the session object on the first page_load.
Instead of adding the ReportDocument directly to a http session use below workflow.
If not ispostback() Dim rpt as new reportdocument() Rpt.Load(pathtoreport) Session.Add(“report”, report) crystalReportviewer.reportsource = rpt else crystalReportviewer.reportsource = session(“report”) end if
- Browser Settings:
Clear the browser cache, browsing history.
In case of IE 9 is used, try compatibility mode.
- Dispose the ReportDocument object:
Clear the %Temp% folder. Delete all the temporary files.
Dispose the ReportDocument object after use, which also deletes the CR Temp files from the memory.
Use the following code in the unload event of the page or the code can also be written in a button press event so that the disposing is ensured manually.
boReportDocument.Close(); boReportDocument.Dispose(); GC.Collect();
- External or Ajax components on the same page:
It has been observed that sometimes if we put some external components such as some third party UI controls or even Ajax controls on the same page as Crystal Reports Viewer the execution of the Ajax components interferes / conflicts with the execution of Crystal components causing the Crystal Reports viewer not to show up.
To identify if this is the cause, try putting the Ajax controls and the CR viewer on different pages. Simple way to do this is redirect to the viewer page one the controls are loaded.
This scenario could not be reproduced every time and in house and thus could not be escalated.
- Use of datasets:
If Datasets are used to pass the data to the report, make sure that the datasets are being populated (after deploying the app). Many a times due to many possible reasons the data does not get populated in the dataset and thus the report shows up blank.
The best way to check is to print the dataset contents on a datagrid or a web page and see if any data is actually getting printed.
- Use of 64 bit applications / tools to deploy the application and associated data connections:
Many customers don’t follow the conventional ways to deploy the web or win apps.
Instead, different tools are used like TFS, Publishing tools, Package builders etc. Few of them are available in both flavours i.e. 32 bit and 64 bit.
If the Crystal Reports .NET application is 32 bit it requires 32 bit database providers / drivers. If the third party publisher is 64 bit, while deploying the app it configures everything as 64 bit which breaks the app on the server. In case of ODBC make sure that the DSN is 32 bit for 32 bit apps.
- Possible errors:
When browser displays a blank page, check the left bottom corner of the browser; see if a yellow triangle is displayed, double clicking it displays the error.
“Bobj is undefined”
This simply means that the application is not able to find / access the CR Viewer files.
“Server Error /”
This mainly gets caused by IIS settings, check the IIS console for additional settings of the application Virtual directory or the application pool.
Use the top right corner search box to get more info on above errors, there is a lot of documentation available.
To get started, see this:
Getting started and moving ahead with Crystal Reports .NET applications.
still get bobj error as well as visual studio 2015 can not reference System after uninstall.
Uninstall is bad practice - should be handled by the install. Moist of trhe SAP stuff is bad practice( and condescending).
Please post your issues to SAP Crystal Reports, version for Visual Studio
Also, this blog was written 4 years ago.
bobj undefined is because your application cannot find or does not have access to this folder:
Simplest way is to copy the C:\inetpub\wwwroot\aspnet_client\system_web into your project and give it full access to it. As the blog explains in a limited extent.
Why is uninstalling bad practice, its available to do so, if it was not good practice one would not be able to use it?
I don't find the SAP stuff moist, or bad practice or condescending
Have a great day
Sorry, was going around in circles.
I think the .net 4.6.1 framework or VS 2015 was corrupted doing the uninstall.
Again, sorry for being rude.