c# - 使用 Syncfusion 在 PdfGrid 中旋转单元格文本
问题描述
如何旋转 PDF 网格标题中的单元格值?
我不想旋转图形。
有没有办法在不使用 Graphics.RotateTransform 的情况下旋转 PdfGrid 中的单元格文本?
我有以下代码:
for (int j = 0; j < dsourceII.Rows.Count; j++)
{
Main2dGrid.Headers[0].Cells[j+1].Value = dsourceII.Rows[j][1].ToString();
}
Main2dGrid.Headers[0].Cells[0].Value = "";
Main2dGrid.Headers[0].Cells[Main2dGrid.Columns.Count-1].Value = "";
foreach (PdfGridCell Cell in Main2dGrid.Headers[0].Cells)
{
// Here I need to rotate all the cell value in Header[0], but not my grid
Cell.StringFormat = STRINGformatRight;
Cell.Style.Font = Tahoma;
Cell.Style.Borders.All = PENWhite;
}
解决方案
我们可以使用 BeginCellEvent 使用带有图形的旋转变换单独旋转 PdfGrid 标题。更多信息请参考知识库链接,
https://www.syncfusion.com/kb/6179/how-to-draw-rotated-headers-in-a-pdf-grid-using-c-and-vb-net
注意:我为 Syncfusion 工作。
推荐阅读
- linux - 如何在 Ubuntu 上构建与 Windows 上相同的 Docker 缓存行为?
- c# - 获取 UWP 的独立存储路径
- python - 以指定的格式填充缺失值
- php - PHP联系表单提交后页面未重定向
- next.js - 使用 next-pwa 安装 PWA 弹出窗口
- scala - 如何使用 ReactiveMongo 使用 post API 返回插入 mongo 的完整对象
- powershell - Jenkins中的Powershell为路径转义字符
- azure-devops - 如果设置为“等于”,Azure DevOps 代理会忽略需求
- javascript - 将文本应用于所有 li 中具有特定类名的第一项
- postgresql - Docker-compose postgres 错误:致命:用户“postgres”的密码验证失败