Solved

Crystal Reports ReportViewer alignment

Posted on 2009-07-12
11
1,349 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
  • 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 100

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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 100

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 100

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 100

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now