Showing posts with label .NET Web Application. Show all posts
Showing posts with label .NET Web Application. Show all posts

Tuesday, 19 April 2016

No result is rendered in Preview mode when using Crystal reports in .NET web application

We encountered this issue with several different reports on different servers. The report would render fine in other modes such as Microsoft Excel or PDF. But when viewing in the default Preview mode, we are not able to see anything loaded and just a blank page. There is no specific information or error logged, either.

All reports may have been working at one stage on the same server before. It can be likely related to the reinstall of Crystal Report runtime on the server but we are not sure the definite cause of the problem. However, the solution is to copy the files according to the steps below.

1) Run the report as usual while having the browser’s dev tool open and Network monitor is running
2) While the report is loading in Preview mode, you will find there will be some 404 error appears in the monitor screen
3) Once the page is loaded, check the 404 error details and see what files were missing
4) The file path would be something starts with c:\inetpub\wwwroot\aspnet_client
5) Navigate to the file path. The two folders that start with 4_0 and 2_0 may contain same files. So you can modify the folder name and copy the right files accordingly. If a folder is completely missing, you may create a new one and copy the content from the existing 4_0 folder.

Note: if your virtual directory is not hosted on the c:\, you may need to do this to the same drive and the entire c:\inetpub folder is required on that drive as well.

Thank you for the person who posted the solution here and there are some variations of this problem that can be fixed in the same way.

Wednesday, 31 December 2014

Specific server name used by sub-reports in Crystal Reports that running in a web application

We use .NET application and Crystal Reports plug-in to run Crystal Reports in the .NET web application. Recently, we discovered that one of the reports we built throws SQL column missing error while running in the web application. It is unusual as all our reports are built in the same way.

At the end, we figured out that it was due to the report uses sub-reports and all sub-reports require to be saved with . as the server name in the Crystal Reports file. So that when it runs from the web application, it would then work successfully. In addition, we found this is the only solution and it will fail even when replacing the . with localhost.

This is an unusual solution that we normally do not see. So I record this here for future references.