cancel
Showing results for 
Search instead for 
Did you mean: 

Page width not updated for Landscape reports

Former Member
0 Kudos

I develop reports outside of Visual Studio 2005, using CR XI R2. I then display them in my application using the CrystalReportViewer. I create the crystal report in code and then set the Zoom level to 1 on the CrystalReportViewer in order to set the report to display to the width of the window. This seems to work for all reports that are created with the Page Setup option set to Portrait. However, for all of my Landscape reports, the CrystalReportViewer doesn't fit the width of the window.

My code is straightforward and comes from an MSDN article (also posting this question there http://social.msdn.microsoft.com/Forums/en-US/libraryfeedback/thread/8dd239b6-d15a-47b2-9815-dfaa1e8...

CrystalReportViewer crv = new CrystalReportViewer();

CrystalReport1 cr = new CrystalReport1();

cr.SetDataSource( datasource );

crv.ReportSource = cr;

crv.Zoom(1);

Thanks for any/all help. I realize this is a .NET problem, but hopefully someone out there has run into this or has some sort of solution.

Edited by: pram3dev on Jun 30, 2009 10:35 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Pram;

I've tried it here with Crystal Reports 2008 and it is working fine for me. I'll see if I can find a system with XI R2 to try. In the meantime, have you installed the latest service pack for Crystal Reports XI R2?

Regards,

Jonathan

Former Member
0 Kudos

HI;

I have tried CR XI R2, and it also works fine for me, displays the landscape report as expected, fitting the width of the page.

You may want to try a different printer or printer driver, or even set the report to "no printer".

Also, do ensure you have the latest service pack for CR XI R2.

Regards,

Jonathan

Former Member
0 Kudos

Hi Jonathon,

I tried setting the printer options of the report to "No Printer" by checking the checkbox on the Page Setup window, but that didn't seem to work.

I'm not sure if I have the latest service pack, though. The Crystal Reports DLLs that I'm using are version 11.5.3700.0. Unfortunately, updating this software is a bit of a hassle for me since I work for a large IT company and the software we are allowed to have on our machines is locked down.

Thanks a lot for your help. Is there a way you could revert to using this version of the DLL and see if you can recreate the problem? I just want to verify this is a CR problem and not something in my code - then I can at least have a business reason behind getting the process started to upgrade to the latest service pack (or CR 2008).

Thanks again.

Former Member
0 Kudos

Hi,

That is the assembly version. Go to windows explorer, and go to the directory: c:\program files\Business Objects\common\3.5\managed\dotnet2\

Find the file CrystalDecisions.CrystalReports.Engine.dll

Right click it and choose properties. On the version tab, what is the file version you have?

Regards,

Jonathan

Former Member
0 Kudos

The file version is 11.5.9708.826.

BTW - I've been able to get this to work when I have my screen resolution set lower - like 800 x 600. However, most of our customers are using 1280x1024, which is where I see the problem. What is interesting is the CrystalReportViewer does say "Zoom Factor: Page Width" in the status bar of the control and if I toggle the zoom from Page Width to Whole Page and then back to Page Width, then it shows up correctly.

Thanks for your continued help.

Former Member
0 Kudos

hi;

That is the exact version I have. I have tried different screen resolutions, and it always works fine for me. What operating system are you on?

Perhaps I am misunderstanding the issue. I will send you an email that you can send screen shots of the problem to.

Regards,

Jonathan

Former Member
0 Kudos

Hi - thanks for your email.

I tried all the code variations, and still do not see the behaviour you are seeing. I wonder if it could have to do with the TabControl?

Can you try running the report not on a tab control, and see if that is the issue?

Regards,

Jonathan

Former Member
0 Kudos

Hi, Philip

Ok, so it's not the tab control. Is your report using a standard paper size, or something else?

Yes, try commenting out each line, and see if one of the lines is causing it.

Also, have you tried a different report - one of our samples perhaps, or just a new, blank report?

Regards,

Jonathan

Former Member
0 Kudos

I've tried all of the above, with no success. The problem only happens with higher screen resolutions (1280 x 1024 or above).

I've also upgraded to Crystal Reports 2008 and I think I've found a reason why this problem happens. With CR 2008, the windows API deprecates the "DisplayGroupTree" boolean property on the CrystalReportViewer. So now, when I view my reports initially, the ReportGroupTree control displays and the report looks like it is formatted to page width. However, for some reports I don't want to show the ReportGroupTree, so I have to manually hide it by looping through the controls in the CrystalReportViewer until I hit the ReportGroupTree, then set its visibility to false. However, doing so brings me all the way back to my original problem with the report not displaying page-width. In fact, it looks like the prolbem occurs because the report is assuming the GroupTree will be shown, so it crops that width out of the report when zooming to Page Width.

Not only do I now have added work because of the deprecated property, I also still have my original problem. Ugh.

Answers (0)