Another one in my occasional series of posts detailing the solution to a programming problem that took a bit of finding ....
Problem:
It's a web project developed in Visual Studio 2005, C# / ASP.Net with a SQL Server 2005 back-end.
The project generates reports using the Crystal Reports engine supplied with VS2005: the reports are designed using the built-in designer and data tools, and included in the install package as resources. The setup project also includes the Crystal resources as detailed in the VS2005_Walkthroughs PDF on the Crystal tech support website.
A crystalreportsviewer control sits on the aspx page with some connection and parameter code behind.
Run locally on the development machine, the reports worked fine: but when the app is deployed, the toolbar icons for the Crystal viewer don't always display, and the popup print and export windows show 'Page Not Found'.
Solution:
Copy the
WINDOWS_DIRECTORY\Microsoft.NET\Framework\v2.0.50727\
ASP.NETClientFiles\CrystalReportWebFormViewer3
directory (with all sub-directories of course) to the root of your production website: e.g. for a standard install of IIS that would put it at
C:\Inetpub\wwwroot\aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3
That was in place on my production server, and is set up, presumably, the first time you run the application MSI with the Crystal MSMs built in.
However if your IIS webroot is redirected to a different location, the Crystal setup still installs the files in C:\Inetpub\wwwroot. Which is fine and dandy, right up until the application uses relative pathnames to point at the resources as if they were in a directory relative to your relocated webroot directory, and of course they are not there.
So if you are redirecting your wwwroot, make sure you copy the CrystalReportWebFormViewer3 directory to there as well, e.g.
WEBROOT\aspnet_client\system_web\2_0_50727\CrystalReportWebFormViewer3
This took me a long time to track down, and I finally got the vital clue from this post by dmcphun on the Business Objects website, so a goodly supply of LeSession virtual beer tokens go to him/her.
Hopefully posting this will make the search easier for the next developer banging their head against this one.
Incidentally this problem illustrates the complexity of creating good Google searches: sometimes the act of including the word or words that you think will produce millions of rogue hits will actually crack the problem wide open.
I'd done lots of Google searches on this one, but it wasn't until I included the phrase "page not found" that I found the post from dmcphun. I'd assumed that 'page not found' would muddy the waters - instead the correct answer was the second hit for crystalreportviewer "page not found" .
Other search engines are of course also available, albeit not all of them with fireman's poles, free-roaming staff dogs, and retired ski-lift gondolas as phone boxes.
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment