- 积分
- 225
- 在线时间
- 134 小时
- 主题
- 23
- 注册时间
- 2013-6-9
- 帖子
- 71
- 最后登录
- 2023-2-9
- 帖子
- 71
- 软币
- 1999
- 在线时间
- 134 小时
- 注册时间
- 2013-6-9
|
针对需要大量报表的项目来说,一个个绘制报表是一件非常痛苦的事情,而因为项目的更换表格的部分信息变化又要重新绘制更是痛苦不堪,有没有方法让XtraReports动态自动生成报表,形成便于维护的报表模板呢?大家请看
(转自:http://www.cnblogs.com/pains/archive/2012/06/14/2549228.html)
来看看报表显示结果
来看看报表的定义文件
/// <summary>
/// 报表布局数组
/// </summary>
private void makeLayoutString()
{
// 报表主要布局
ReportLayout = new string[][][]
{
// 报表头标题布局
new string[][]
{
// 报表标题
new string[] { "××至××西线高速公路","房建工程清单支付报表" },
// 报表其它头标题
new string[] { "1", "承包单位", "4" },
new string[] { "2", "合同段", "2" },
new string[] { "3", "填报日期", "2" },
new string[] { "4", "监理单位", "4" },
new string[] { "5", "期号", "2" } ,
new string[] { "6", "截止日期","2"}
},
// 报表明细布局
new string[][]
{
new string[] { "1", "项目编号", "89" ,"22"},
new string[] { "2", "项目名称", "200","6" },
new string[] { "3", "c单位", "20" },
new string[] { "4", "r合同数量", "100" },
new string[] { "5", "r单价", "30" },
new string[] { "6", "r变更后数量", "100" },
new string[] { "7", "r本期末完成数量", "100" },
new string[] { "8", "r本期末完成金额","100"},
new string[] { "9", "r上期末完成数量", "100" },
new string[] { "10", "r上期末完成金额", "100" },
new string[] { "11", "r本期完成数量", "70" },
new string[] { "12", "r本期完成金额", "80" },
},
new string[][]
{
new string[]{"1","承包人","1"},
new string[]{"2","监理处专业工程师","1"},
new string[]{"3","监理处计量工程师","1"},
new string[]{"4","高级驻地","1"},
new string[]{"5","计划部专业工程师","1"},
new string[]{"6","合约部计量工程师","1"}
}
};
// 报表统计布局(未用)
mTotalLayout = new string[][]
{
new string[]{"小计","289"},
new string[]{"","20"},
new string[]{"","100"},
new string[]{"","30"},
new string[]{"","100"},
new string[]{"","100"},
new string[]{"8","100",DevExpress.XtraReports.UI.SummaryFunc.Sum.ToString()},
new string[]{"","100"},
new string[]{"10","100",DevExpress.XtraReports.UI.SummaryFunc.Sum.ToString()},
new string[]{"","70"},
new string[]{"12","80",DevExpress.XtraReports.UI.SummaryFunc.Sum.ToString()},
};
// 报表分组布局
mGroupLayout = new string[]
{
"1","dfasdf"
};
//报表明细列头布局
mdetailHeadLayout = new string[][]
{
new string[] { "项目编号", "89" },
new string[] { "项目名称", "200" },
new string[] { "单位", "20" },
new string[] { "合同数量", "230" },
new string[] { "到本期末完成", "200" },
new string[] { "到上期末完成", "200" },
new string[] { "本期完成", "150" },
new string[] { "", "89" },
new string[] { "", "200" },
new string[] { "", "20" },
new string[] { "原合同数量", "100" },
new string[] { "单价", "30" },
new string[] { "变更后数量", "100" },
new string[] { "数量", "100" },
new string[] { "金额(元)","100"},
new string[] { "数量", "100" },
new string[] { "金额(元)", "100" },
new string[] { "数量", "70" },
new string[] { "金额(元)", "80" }
};
}
这样就形成了模板文件,对于移植更改维护相当的方便。那么对于不规则类的表格可不可以做呢?大家请看
对于项目中一次打印审批数量非常的表格,也可以加上条形码,配上扫描设备就便于查找审批了
|
评分
-
查看全部评分
|