How to position a text inclined in Reportviewer?

Asked

Viewed 167 times

2

There is a way to tilt a word (textbox, or other possible way), in Reportviewer, to stay at 45º (degrees), for example?

  • 1

    45 degrees I don’t know, but I found this: http://msdn.microsoft.com/en-us/library/ee633659.aspx

1 answer

1


There is a somewhat crude form. You can use the graphical framework libraries to insert the text in the report as image.

You start by getting a class object Graphics. There are several ways... From the method Control.CreateGraphic, from image, or as property you receive in a method that treats the event Control.Paint.

Let’s Suport a graphical object g, a source f and a Brush b. The source and the Brush are parameters that we will use, you can see more details in the above documentation. With these objects, we do something like this:

g.RotateTransform(45);
/* Isso gira sua "tela de pintura" no objeto de gráfico.
 * A partir de agora, tudo que for inserido no gráfico
 * estará inclinado em 45°.
 */
g.DrawString("foo",f, b, 10, 10);

A warning: the chart coordinate system itself will be tilted. If something exits off the screen, position the graph.

Good luck!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.