?
Solved

Crystal Reports ReportViewer alignment

Posted on 2009-07-12
11
Medium Priority
?
1,472 Views
1 Endorsement
Last Modified: 2013-12-17
I'm having problem with the ReportViewer control alignment.
If I change the paper orientation to portrait, the report will be shown in the center.
But if I change the paper orientation to landscape, the report will be shown on the top left.

Unfortunately, I need to display reports using both orientations. And this is not acceptable to the users.
While I know this is just cosmetics issue, but users insist on having it centered.
Does anybody know how to control the ReportViewer appearance?

Test project is attached. To open:
1. Unzip Envelope.zip
2. Rename WindowsApplication.txt to WindowsApplication.zip
3. Unzip WindowsApplication.zip

Portrait.PNG
Landscape.PNG
Envelope.zip
1
Comment
Question by:philipjonathan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24842068
I don't understand your comment, "If I change the paper orientation to portrait, the report will be shown in the center."  The report is still being shown from the left.  How are you changing the orientation?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24844770
A report is designed on the page.  Centering and other alignment is done to the fields based on the object they are in.

When you change a portrait report to landscape the width changes from 8.5 inches to 11 inches.
If the report is built for portrait then changing the orientation to landscape simply adds 2.5 inches of white space to the right of the report.

When do they change the orientation?
If it is in the report designer then simply change the left margin to 1.25 inches plus the margin set in the portrait report.  Set the right margin to the same value.

If they are trying to do this when they run the report through a viewing application, ther is no way to accomplish what you want without extensive coding in the application to set the paper size and margins.

mlmcc
0
 
LVL 18

Author Comment

by:philipjonathan
ID: 24845474
Hi all, thanks for replying.
What I mean is the position of the page relative to the ReportViewer control. As shown in the attached:
* For portrait, it is at the center of the ReportViewer
* For landscape, it is at the top left of the ReportViewer
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 24849275
Aah, the entire page, not the report output (gotcha!!).

I don't believe that you have any control over that positioning, but some magic might be possible.
0
 
LVL 18

Author Comment

by:philipjonathan
ID: 24855903
and that magic is .... ?  :)
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24858402
"might" means that I can't dismiss that something is possible, but also suggests that I have no idea...
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24861699
The only way  I can think of is to change the margins of the page on the fly so if you choose portrait they will be .5" and in landscape 1.75"

I am not sure if you can change the margins on th efly  that way or not.

What version  of Crystal?

How are you running the reports?

mlmcc
0
 
LVL 18

Author Comment

by:philipjonathan
ID: 24867826
mlmcc, how do I change the margins?

>What version  of Crystal?
I couldn't find the Crystal Reports version anywhere, it only says:
"Crystal Reports for Visual Studio 2005"

>How are you running the reports?
I run create the ReportViewer control and sets the ReportSource to the ReportClass object during Form.Load event.
The ReportClass itself gets the data from Excel file.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 24891868
I don't think in that version you can control the margins from code.

You may need to create a landscape version then in the code open the one they want.

mlmcc
0
 
LVL 18

Author Comment

by:philipjonathan
ID: 24891877
mlmcc, thanks again. Just to clarify, my problem is the report page being shown on top left of the ReportViewer when I use landscape mode, doesn't matter if I set the page size (& margin) at design-time or run-time. After trying with the margin, it doesn't solve my problem.
I seems that there is no viable options.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 24891917
When you say it doesn't work to set the margins.  Are you looking to center both vertically and horizontally?

mlmcc
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question