akseffect
November 27th, 2004, 04:46 AM
ENVIRONMENT:
Development Platform - VS.NET 2003
Technology - ASP.NET
Language - VB.NET
Reporting Tool - CR 10 Embedded Enterprise
WHAT LED TO THIS INVESTIGATION:
The project is basically a report-handling project. Even after deployment, new reports will be designed and set up in such a way that the application can handle them.
Currently, I have 10 reports; 7 designed with Landscape Orientation and 3 designed with Portrait Orientation.
Exporting is allowed in 3 formats:
1. Acrobat format - pdf
2. MS Word format - doc
3. MS Excel format - xls
The reports were generated and exported to each of the 3 formats. Reports (designed in Portrait) had no problem with page orientation. However, if a report (designed in
Landscape) was exported, all fields were found to be intact, but this is what happened to the Page Orientation:
1. To pdf - Portrait (but a printout turned out to be in Landscape Orientation).
2. To doc - Landscape.
3. To xls - Portrait.
Of course, an investigation followed.
WHAT THE INVESTIGATION REVEALED:
I used the following method to set the Orientation before exporting:
PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationLandscape)
which means that any report exported to Excel should have Landscape orientation.
Result: Unsuccessful, still portrait.
Note: Changing the PrintMode of the CrystalReportViewer Control also did not solve the problem.
Found the following explanation for the behaviour with Acrobat:
http://support.businessobjects.com/library/kbase/articles/c2013606.asp
and the following explanation finally caught the main culprit. A bug in CR.
http://support.businessobjects.com/library/kbase/articles/c2015429.asp
So, I downloaded the hotfixes and installed them.
PROBLEM SOLVED? THINK AGAIN!!! THIS WAS JUST THE BEGINNING:
The previous CrystalDecisions.Web dll (in the C:\Program Files\Common Files\Crystal Decisions\2.5\managed folder) had the version number as 10.0.3300.0, which has
been overwritten by new version 10.0.9500.0
I tried referencing the new version of the dll in my application. Guess what! The reference was still pointing to the older version. To check, I set CopyLocal to true, and verified
that the referenced dll actually is of the new version. I tried everything (even checked using a new application), but VS.NET still insisted that I was referencing the older
version. Also, the orientation problem was not solved.
I soon noticed that the GAC (C:\WINNT\Assembly) did not show the latest version. Ok, so it seems that the patches did not install the latest version in the GAC, which is
why I cannot reference it in .NET. I even tried the latest hotfixes:
http://support.businessobjects.com/fix/hot/mhf/crystalreports.asp#05
But even that did not solve the problem.
I installed the new version of the dll in the GAC myself. But even after successful installationin, the GAC still showed the older version. So where the **** did the new version go!
That was when I decided to get my hands dirty. Here's what I did:
1. Using the command prompt, navigate to C:\Winnt\Assembly\GAC\CrystalDecisions.Web folder.
2. Check the contents. It contains a directory like 10.0.3300.0__692fbea5521e1304
3. This directory contains 2 files: CrystalDecisions.Web.dll and __AssemblyInfo__.ini
4. Open the __AssemblyInfo__.ini using the command prompt editor. It shows the older version (10.0.3300.0)
5. Then I copied the .dll file to another location.
6. Navigated to the dll using Windows Explorer, and physically checked the version of the dll. Well....it was 10.0.9500.0 (the new version)
So this indicates that the new dll has overwritten the older one in the GAC. If we rename the folder appropriately and edit the AssemblyInfo file, the GAC indicates the correct
version, but this still does not solve the problem.
Since the patches are not working properly, the problem may have to be tackled using some script on the client. Dont know if this is possible yet. Will continue investigating
this orientation issue further. Any suggestions / ideas will definitely be appreciated.
Development Platform - VS.NET 2003
Technology - ASP.NET
Language - VB.NET
Reporting Tool - CR 10 Embedded Enterprise
WHAT LED TO THIS INVESTIGATION:
The project is basically a report-handling project. Even after deployment, new reports will be designed and set up in such a way that the application can handle them.
Currently, I have 10 reports; 7 designed with Landscape Orientation and 3 designed with Portrait Orientation.
Exporting is allowed in 3 formats:
1. Acrobat format - pdf
2. MS Word format - doc
3. MS Excel format - xls
The reports were generated and exported to each of the 3 formats. Reports (designed in Portrait) had no problem with page orientation. However, if a report (designed in
Landscape) was exported, all fields were found to be intact, but this is what happened to the Page Orientation:
1. To pdf - Portrait (but a printout turned out to be in Landscape Orientation).
2. To doc - Landscape.
3. To xls - Portrait.
Of course, an investigation followed.
WHAT THE INVESTIGATION REVEALED:
I used the following method to set the Orientation before exporting:
PrintOutputController.ModifyPaperOrientation(CrPaperOrientationEnum.crPaperOrientationLandscape)
which means that any report exported to Excel should have Landscape orientation.
Result: Unsuccessful, still portrait.
Note: Changing the PrintMode of the CrystalReportViewer Control also did not solve the problem.
Found the following explanation for the behaviour with Acrobat:
http://support.businessobjects.com/library/kbase/articles/c2013606.asp
and the following explanation finally caught the main culprit. A bug in CR.
http://support.businessobjects.com/library/kbase/articles/c2015429.asp
So, I downloaded the hotfixes and installed them.
PROBLEM SOLVED? THINK AGAIN!!! THIS WAS JUST THE BEGINNING:
The previous CrystalDecisions.Web dll (in the C:\Program Files\Common Files\Crystal Decisions\2.5\managed folder) had the version number as 10.0.3300.0, which has
been overwritten by new version 10.0.9500.0
I tried referencing the new version of the dll in my application. Guess what! The reference was still pointing to the older version. To check, I set CopyLocal to true, and verified
that the referenced dll actually is of the new version. I tried everything (even checked using a new application), but VS.NET still insisted that I was referencing the older
version. Also, the orientation problem was not solved.
I soon noticed that the GAC (C:\WINNT\Assembly) did not show the latest version. Ok, so it seems that the patches did not install the latest version in the GAC, which is
why I cannot reference it in .NET. I even tried the latest hotfixes:
http://support.businessobjects.com/fix/hot/mhf/crystalreports.asp#05
But even that did not solve the problem.
I installed the new version of the dll in the GAC myself. But even after successful installationin, the GAC still showed the older version. So where the **** did the new version go!
That was when I decided to get my hands dirty. Here's what I did:
1. Using the command prompt, navigate to C:\Winnt\Assembly\GAC\CrystalDecisions.Web folder.
2. Check the contents. It contains a directory like 10.0.3300.0__692fbea5521e1304
3. This directory contains 2 files: CrystalDecisions.Web.dll and __AssemblyInfo__.ini
4. Open the __AssemblyInfo__.ini using the command prompt editor. It shows the older version (10.0.3300.0)
5. Then I copied the .dll file to another location.
6. Navigated to the dll using Windows Explorer, and physically checked the version of the dll. Well....it was 10.0.9500.0 (the new version)
So this indicates that the new dll has overwritten the older one in the GAC. If we rename the folder appropriately and edit the AssemblyInfo file, the GAC indicates the correct
version, but this still does not solve the problem.
Since the patches are not working properly, the problem may have to be tackled using some script on the client. Dont know if this is possible yet. Will continue investigating
this orientation issue further. Any suggestions / ideas will definitely be appreciated.