Wednesday, March 2, 2011

Crystal Reports with Visual Studio

Recently I was trying to work with Crystal Reports for learning purpose and I have ran through couple of issues. Solutions to these issues were trivial but took good amount of time in research.

It goes without saying that you should have a valid installation of Visual Studio with crystal report basic and valid license on the server for running crystal reports.

Issue No. 1 - Can't see images for Crystal report viewer, or not able to use the export, print functionalities when deployed to another web server.

Solution : This happens because crystal repots viewer assumes a very specific directory structure for the images and scripts. If you are running IIS on your development machine, you can find the structure here "C:\inetpub\wwwroot\aspnet_client\System_Web\2_0_50727\CrystalReportWebFormViewer4"


Now all you have to do is that copy the content of this whole structure, right from aspnet_client to your webserver and create a virtual directory to point to this path. Even if you dont want to create a virtual directory or dont have access to do so, you can simply copy the full structure to the root of your webapp and that should do the magic.


If you are not using IIS and using a inbuilt webserver with Visual studio (cassini i.e.), still you will have this structure , only thing that in this case it would be available at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ASP.NETClientFiles

Inserting code in blogger was never so easy

I have always struggle for inserting code in my blog.
//Now it seems to be easy
Many thanks to him http://pleasemakeanote.blogspot.com/2008/06/posting-source-code-in-blogger.html for sharing the knowledge