Crystal Reports ReportViewer alignment

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
LVL 18
philipjonathanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
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
mlmccCommented:
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
philipjonathanAuthor Commented:
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
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Bob LearnedCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
philipjonathanAuthor Commented:
and that magic is .... ?  :)
0
Bob LearnedCommented:
"might" means that I can't dismiss that something is possible, but also suggests that I have no idea...
0
mlmccCommented:
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
philipjonathanAuthor Commented:
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
mlmccCommented:
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
philipjonathanAuthor Commented:
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
mlmccCommented:
When you say it doesn't work to set the margins.  Are you looking to center both vertically and horizontally?

mlmcc
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.