c# - ActiveReports 13 垂直文本间距
问题描述
我正在尝试在 ActiveReports 13 中垂直对齐文本。我正在用代码创建此报告。我要匹配的示例是这样的:
然而,经过我的努力,我的结果最终看起来像这样:
即使数据源中的文本是正确的,间距似乎在奇数点中断。我正在使用的代码是:
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 度:
有什么建议么?
解决方案
我发现解决这个问题的方法是将 TextBox 转换为 Label,然后将 Angle 属性更改为 2700。将 Alignment 设置为“Right”也可以按照我想要的方式对齐文本:
ctl = new GrapeCity.ActiveReports.SectionReportModel.Label();
ctl.Angle = 2700;
ctl.Alignment = GrapeCity.ActiveReports.Drawing.TextAlignment.Right;
推荐阅读
- android - 为什么“抽象方法'onCreateViewHolder(ViewGroup,int)'不能在处理项目点击recyclerview时直接访问
- c# - 如何检测表达式结果的实际类型?
- python - 使用 Paramiko 的 Python 正则表达式
- node.js - 如何处理断开连接事件?
- erpnext - BOM ERP 中的 UOM 转换下一个
- c# - 比较两个具有多个键的 DataTables 并选择第二个表中不存在的行
- jquery - 查找特定选择器 Jquery 之前的所有链接
- progressive-web-apps - 如何触发 PWA 的“添加到主屏幕”提示?
- c# - 操作系统范围的键盘输入覆盖?
- mongodb - 对象数组的mongo存储库查询