Skip to content

Rotate Text in ReportViewer RDLC

December 21, 2011

I’m working on other things for the moment, but I remember I was scratching my head half a year ago trying to put rotated text on a reportviewer localreport.

I was new to reportviewer and google was my mentor. We played along quite well until the issue with rotating text came up. Google gave me lots of tips, and most of the solutions was to write to Graphics object used to paint the page and rotate text manually (try searching ‘rotate text reportviewer’ yourself)

This worked fine, but then the rotated didn’t show up in the preview with the built in reportviewer control, because the “magic” with adding the vertical text happens when the reports is being written to the printer.

I spent a lot of time struggling with manually rotating with the Graphics object and the code wasn’t very friendly.

Today, a colleague of mine was working on a report and said to me. “Hey, Martin, remember when you struggled with the vertical text? Why didn’t you just use the WritingMode property on textbox?”

ARGH! I cannot believe I didn’t see that! To all of you: If you are going to write vertical text in reportviewer, there is a property on the TextBox “WritingMode” which can be set to “Vertical”. However, if you want to display text in other directions or angles, you have to use the first alternative with the Graphics object.

From → .Net

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: