Solved

Crystal Reports ReportViewer alignment

Posted on 2009-07-12
11
1,435 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
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!

 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 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 250 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

Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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