Sample Reference - Schema Reference - Configuration Reference - API (Javadoc)
|
|
|
|
JasperReports - Rotation Sample (version 4.0.1) | |
|
|
|
Main Features in This Sample | |
| Rotated Text |
|
|
||||
top | |||||
|
|||||
Rotated Text | Documented by Sanda Zaharia | ||||
|
|||||
| Description / Goal |
| How to rotate text elements. | ||
| Since |
| 0.5.2 | ||
|
|||||
|
Rotating paragraphs
There are three possibilities to rotate a text paragraph:
For example, let's consider a paragraph with Left horizontal alignment and Top vertical alignment. If this paragraph is rotated to the left, then it will be positioned into the left bottom area of its textbox container.
The vertical alignment will change from Top to Bottom , and the text will flow from bottom to top.
Performing various combinations between horizontal alignment, vertical alignment and text's flow direction, leads to a large set of paragraph positions relative to its textbox container. In JasperReports calculations related to text rotation are done at export time, based on the text element's textAlignment , verticalAlignment and rotation attributes values.
Examples of combining horizontal alignment, vertical alignment and rotation in a <textElement /> element. Values allowed for the horizontal alignment are: Left , Center , Right and Justified . By default, horizontal alignment is set to Left .
Values allowed for the vertical alignment are: Top , Middle and Bottom . By default, vertical alignment is set to Top .
Values allowed for the text rotation are: None , Left , Right and UpsideDown . By default, text rotation is set to None .
Below are some possible combinations between them:
Below is a code snippet showing how to set text alignment and rotation in a static text. In this case the paragraph is horizontally centered, vertically aligned to bottom and rotated to the left:
<staticText>
Running the Sample Running the sample requires the Apache Ant library. Make sure that ant is already installed on your system (version 1.5 or later).
In a command prompt/terminal window set the current folder to demo/samples/rotation within the JasperReports source project and run the > ant test view command.
It will generate all supported document types containing the sample report in the demo/samples/rotation/build/reports directory.
Then the report will open in the JasperReports internal viewer. |
||||
|
|
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com |