Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page layout from CrystalReportViewer component

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm having some issues with a Crystal Report viewer component as added to a C#.NET application.
My reports that are being previewed in it are set to be landscape (due to the nature of the report) and have sufficient but minimal margins on the right and at the bottom.
When I preview and print the report(s) from the scope of my application from the Crystal Report Viewer the reports come out as Potrait and have widened margins such that the printed pages are not as required.
I can set the page to be landscape through the 'Print' button option due to printer settings but still have an issue where I get additional whitespace on the right hand side and at the bottom such that I can cut some information off when I review the physical printed page.

How can I prevent the page layout coming out wrong ?
i.e. acknowledge the fact that the report was designed to be landscape and maintain this orientation.

And how do I not have additional whitespace in the right / bottom margin ?
I'm guessing these are options / settings at either the report / viewer level as is the case when setting up reports from Boland Delphi.

Can anyone shed any light on these issues ?

Thanks in advance
Steve
 
Open the report in the Crystal Report Designer. Click on File and then select Printer Setup. Change the printer to the one you want and choose landscape, then click OK. Then save the report. The Printer settings are saved with the report. For best results select the same printer in the designer that you will be using to print from in the viewer. As for your margins, I've noticed the .NET crystal viewer doesn't always convert the page margins properly from inches. You can change the margins in .NET, but it is much more involved.
 
The report has been saved in this manner. It was designed in Landscape format.
I've even gone as far as using C# syntax to set the Orientation to be LandScape.
Again this seems to be taking no effect.

Someone (on another forum) has suggested that I need to apply a fix to CR to get around the fact that C# will always present Crystal Reports in Portrait layout.

Is there any other way ?
I'd like to think there's a way around this besides having to install fix(es).

Any further feedback would be appreciated.

Thanks so far.
Steve
 
As it happens I'm using reports that were designed within CR8 (I know that I should upgrade!!).
Is this potentially where my problem lies ?
I know that reports designed through CR8 did not give any similar issues when setting up and previewing reports through Borland Delphi. :(

Steve
 
We are using the .NET viewer to display reports created in 8 and 8.5 without problem, so I wouldn't think that would be your issue.
 
Using CR 8 and the .NET Crystal Report viewer component have you not had to allow for the issues of page orientation and margins ?
Have you already applied the fix or am I just unlucky on this one ? :(
Steve
 
I think all of our CR 8 reports were portrait anyway, but I don't remember having an orientation problem ever. I did have a margin problem on all versions of crystal reports where it would look right on screen but cut off parts in the right and bottom margins when printed. I just installed the .NET CR viewer fix a couple days ago, and it did fix the margin problem on my subsequent builds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top