如何将 DevExpress MVC Grid header 文本导出为垂直(从下到上)
How to change DevExpress MVC Grid header text on export to vertical (from bottom to top)
我正在使用 DevExpress v14.1 将网格内容导出为图像。
整个功能正常,我什至让header以垂直模式显示
settings.SettingsExport.RenderBrick += (s, e) => {
if (e.RowType == GridViewRowType.Header)
{
e.BrickStyle.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat( StringFormatFlags.DirectionVertical | StringFormatFlags.NoClip | StringFormatFlags.NoWrap);
return;
}
else if (e.RowType != GridViewRowType.Data)
{
return;
}
但是我得到的文本是从 header 的顶部开始一直到底部,而我想要的是另一种方式,从 header 的底部到顶部。
这是 DevExpress 论坛的答案。
Hello,
As far as I understand you need to turn headers 180 degrees. I researched this scenario and found that RenderBrick does not provide the capability to do this. You can use our XtraReports suite that provides wide capabilities for export and allows the grid export. See the Create a Table Report documentation article. Let me know if you need any further assistance.
As for your second question, the cell size is calculated earlier than RenderBrick is raised based on cell content. RenderBrick allows customizing the exported text style but without changing cell size. So, your workaround is appropriate in this case.
我正在使用 DevExpress v14.1 将网格内容导出为图像。
整个功能正常,我什至让header以垂直模式显示
settings.SettingsExport.RenderBrick += (s, e) => {
if (e.RowType == GridViewRowType.Header)
{
e.BrickStyle.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat( StringFormatFlags.DirectionVertical | StringFormatFlags.NoClip | StringFormatFlags.NoWrap);
return;
}
else if (e.RowType != GridViewRowType.Data)
{
return;
}
但是我得到的文本是从 header 的顶部开始一直到底部,而我想要的是另一种方式,从 header 的底部到顶部。
这是 DevExpress 论坛的答案。
Hello, As far as I understand you need to turn headers 180 degrees. I researched this scenario and found that RenderBrick does not provide the capability to do this. You can use our XtraReports suite that provides wide capabilities for export and allows the grid export. See the Create a Table Report documentation article. Let me know if you need any further assistance.
As for your second question, the cell size is calculated earlier than RenderBrick is raised based on cell content. RenderBrick allows customizing the exported text style but without changing cell size. So, your workaround is appropriate in this case.