Search code examples
c#activereports

ActiveReports 13 Vertical Text spacing


I am trying to vertically align text in ActiveReports 13. I am creating this report in code. The example I am trying to match is this:

enter image description here

However, after my efforts to do it, my result ends up looking like this:

enter image description here

The spacing seems to break at odd spots, even though the text in the data source is correct. The code I am using is:

for (int i = 0; i < dataTable.Columns.Count; i++)
{
    ctl = new GrapeCity.ActiveReports.SectionReportModel.TextBox();
    ctl.Name = columnName;
    ctl.Text = dt.Columns[i].ColumnName;
    ctl.Location = new PointF((0.3f * i) + 1.7f, 0.4f);
    ctl.Size = new SizeF(0.3f, 1.0f);
 
    ctl.VerticalText = true;
    ctl.VerticalAlignment = GrapeCity.ActiveReports.Drawing.VerticalTextAlignment.Middle;
}

Increasing the width doesn't help. If I narrow the Size value and adjust the CharacterSpacings, the text spacing problem improves, but the background is narrowed and the text alignment shifts - the characters are rotated 90 degrees:

enter image description here

Any suggestions?


Solution

  • I found the way to solve this was to convert the TextBox to a Label, and then change the Angle property to 2700. Setting the Alignment to "Right" also aligned the text just how I wanted it:

    ctl = new GrapeCity.ActiveReports.SectionReportModel.Label();
    ctl.Angle = 2700;
    ctl.Alignment = GrapeCity.ActiveReports.Drawing.TextAlignment.Right;