user649551
user649551

Reputation: 21

Rotate column text by 60 degrees

How would you rotate column text 60 degrees for a report in iReport?

Upvotes: 2

Views: 3621

Answers (2)

Dave Jarvis
Dave Jarvis

Reputation: 31171

The iReport tool, to my knowledge, does not natively support rotated text. This leaves you with few options, which I have outlined.

Solution #1

Manually create a static image that has the text already rotated using a graphics editor such as Inkscape. Embed that image in the report as the report column name.

Solution #2

Automatically create a static image with rotated text using a command-line based tool such as ImageMagick. Embed the image as before.

Solution #3

Create a web service that can, when given a text string, angle, and fount (i.e., font size, weight, and family) generate an image accordingly. Embed the image using this URL and make the URL an expression that uses the column text as the string draw at an angle. For example:

http://localhost:9000/ImageServlet?text=$V{text}&angle=60&family=Arial&size=12pt

Note the use of $V{text}. Also note that the syntax is incorrect, but should give you an idea of what is required.

Solution #4

Develop a class that can customize the report. For this you would have to use the iText API and JasperReports API to determine the requisite method calls.

Upvotes: 4

Arthur Ducasse
Arthur Ducasse

Reputation: 11

I wrote a scriptlet for that task. It created an image with the roated text, below is a transparent background. Font family, style and size, text color and so on can be set in jasper layout. See there for more details and code: http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=52656#99620

Upvotes: 1

Related Questions