万能报表通过脚本自定义单元格样式
效果图:
脚本:
private void table2_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
XRTable xrtable = sender as XRTable;
XRTableRowCollection xrtableRowCollection = xrtable.Rows;
int numRow = xrtableRowCollection.Count;
for (int iC = 0; iC < numRow; iC++)
{
XRTableRow xrtableRow = xrtableRowCollection[iC];
XRTableCellCollection xrtableCellCollection = xrtableRow.Cells;
int numColumn = xrtableCellCollection.Count;
for (int iR = 0; iR < numColumn; iR++)
{
XRTableCell xrtableCell = xrtableCellCollection[iR];
if (iR == 0){
xrtableCell.BackColor = Color.Green;
}
else if (iR == 1)
{
string value = xrtableCell.Text;
if (value.Equals("手表"))
{
xrtableCell.BackColor = Color.Red;
xrtableCell.Font = new System.Drawing.Font("宋体", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0)));
}
else
{
xrtableCell.BackColor = Color.LightGray;
xrtableCell.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
}
}
}
}
}
万能报表通过脚本自定义单元格样式
本文2024-09-23 04:14:20发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-164024.html
- 鼎捷EAI整合規範文件V3.1.07 (集團).pdf
- 鼎捷OpenAPI應用場景說明_基礎資料.pdf
- 鼎捷OpenAPI應用場景說明_財務管理.pdf
- 鼎捷T100 API設計器使用手冊T100 APIDesigner(V1.0).docx
- 鼎新e-GoB2雲端ERP B2 線上課程E6-2應付票據整批郵寄 領取.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A4使用者建立權限設定.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程C3會計開帳與會計傳票.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程E6-1應付票據.pdf
- 鼎新e-GoB2雲端ERP B2 線上課程A5-1進銷存參數設定(初階篇).pdf
- 鼎新e-GoB2雲端ERP B2 線上課程D2帳款開帳與票據開帳.pdf