ActiveReports 13垂直文本间距

时间:2020-06-24 14:22:16

标签: c# activereports

我试图在ActiveReports 13中垂直对齐文本。我正在代码中创建此报告。我要匹配的示例是这样:

https://developer.paypal.com/demo/checkout/#/pattern/client

但是,经过我的努力,我的结果最终看起来像这样:

enter image description here

即使数据源中的文本正确,间距似乎也会在奇数点中断。我正在使用的代码是:

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;
}

增加宽度没有帮助。如果我缩小Size值并调整CharacterSpacings,则文本间距问题会得到改善,但是背景会变窄,并且文本对齐方式会发生变化-字符会旋转90度:

enter image description here

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我发现解决此问题的方法是将TextBox转换为Label,然后将Angle属性更改为2700。将Alignment设置为“ Right”也可以按照我的需要对齐文本:

overlap()
相关问题