Symptom
Using SAP Crystal Reports for Visual Studio 2010 (13.x)Support Pack 18
- In a web site in .net framework 4.5 using the crystalreportviewer control to show a report inside a web page.
- When using the web viewer, crystal will show a red icon/missing picture icon in place of an image in the report.
- There is possibly other ways to get this to happen, but one of those that I found is to add a box to the report, set a back color, and round the corner of that box. Crystal 12 web preview would have send an html control to the web page for the box. The color would have been correct, but there would be no rounding. In crystal 13, an image is instead send when either the rounding is activated, or a back color is set.
- Basically what is happen is that when the report is rendered using the html renderer, the box is not saved as a picture on the disk, but html is generated as if it was saved to the disk (with a picture name). Process monitor show that IIS will never save the file to the disk.
- When the web page is shown on the browser, the browser will try to get the picture, but as the picture was never saved to disk, it fail to get it, and show a red icon instead of the missing image. When trying to load the picture directly from a browser following the picture link, the server send a 404 not found. When the browser tries to access the picture with an url like "CrystalImageHandler.aspx?dynamicimage=cr_tmp_image_469a4e7e-e989-496f-873c-2dfa0d5dd669.png", CrystalImageHandler is a handler registered in the website web.config underhttpHandlers or handlers.CrystalDecisions.Web.CrystalImageHandler is registered and will process any request with that url.
- I have looked at the code inCrystalDecisions.Web\CrystalDecisions\Web\CrystalImageHandler, function ProcessRequest. If the file is not found and the FileStream return an exception, the returned message to the browser will be a 404 not found.
- I found that Support Pack 17 does not have this issue. It correctly saves to disk the image of the rounded box, and then shows it in the browser.
- Using .net framework 4.0 instead of 4.5 showed the same result.
- Note: Using the export functionality of the web viewer to pdf will correctly render the rounded box.
- Also, the bug I describe also happens when using .net 4.0.
Environment
Crystal Report for Visual Studio SP 18 and SP 19
Resolution
This issue has been escalated to R&D for a solution in SP 20 - Due out in May some time.
Keywords
CR for VS, 404 error, CR Box object, CR Box rounded corners , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem
Product
SAP Crystal Reports, developer version for Microsoft Visual Studio