博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
发布一快速开发报表的类库,让报表的开发具有前所未有的方便和快速
阅读量:4683 次
发布时间:2019-06-09

本文共 5310 字,大约阅读时间需要 17 分钟。

原文:

  因大量博友的索要,现与朋友合作封装了使用的组件,这篇文章用来介绍这个ReportCommon自绘报表组件并一些截图,如果需要请进行购买,邮件中写上您的邮箱。

声明:本类库使用DevExpress控件,但不包含DevExpress控件,因此使用者需要另行购买DevExpress控件,如果使用者因盗版DevExpress控件引起的一切法律纠纷,由使用者自行承担,本人及相关开发人员盖不负责。

 装配清单

RptDLL  
├  ReportCommon.dll 关键DLL
├  ReportCommon.xml 注释
├  Util.dll  
├  FrmReportView 多组报表显示窗体组件
└  ReportsView 多组报表显示可视化组件
ReportCommon自绘报表控件说明.doc 帮助文档
test Demo项目

使用条件

  1. 本组件基于DevExpress报表控件开发,因此确定您拥有并使用DevExpress这套控件,需要的DevExpress DLL在帮助文档中有说明;
  2. 本组件兼容DevExpress9.0及以后的版本,对应8.0及以前的版本可能需要我们修改部分代码。

功能说明

  1. 中式报表应该基本能做,有分组统计功能,可以设置各列字体和大小,可以定义页边距,可以设定表格数据对齐方式,显示关闭打印预览线,可以定义页眉页脚,可以添加公司标识等60余项参数定制;
  2. 各种报表获取方法:

ShowPreview() 在单独的窗体显示报表

ShowPreviewDialog() 在单独的对话框显示报表
returnPages() 获取报表所有Pages
ShowInThisFormPrintsystem()在指定的PrintSystem中显示报表
GetReport() 获取绘制完的报表

Demo项目使用的DevExpress DLL

DevExpress.Charts.v11.1.Core.dll
DevExpress.Data.v11.1.dll
DevExpress.PivotGrid.v11.1.Core.dll
DevExpress.Printing.v11.1.Core.dll
DevExpress.Reports.v11.1.Designer.dll
DevExpress.Utils.v11.1.dll
DevExpress.XtraBars.v11.1.dll
DevExpress.XtraCharts.v11.1.dll
DevExpress.XtraEditors.v11.1.dll
DevExpress.XtraPivotGrid.v11.1.dll
DevExpress.XtraPrinting.v11.1.dll
DevExpress.XtraReports.v11.1.dll
DevExpress.XtraReports.v11.1.Extensions.dll
DevExpress.XtraTreeList.v11.1.dll

来看看简单报表是怎么定义的

 

///         /// 报表布局数组        ///         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" } }; }

 

 

 再来看看Demo中的显示效果

 

 附上其他报表的显示效果

 条形码支持

posted on
2014-05-05 13:44 阅读(
...) 评论(
...)

转载于:https://www.cnblogs.com/lonelyxmas/p/3709052.html

你可能感兴趣的文章
Java之字符流操作-复制文件
查看>>
iOS开发UI篇—实现一个私人通讯录小应用(二)
查看>>
iOS开发UI篇—UITableview控件使用小结
查看>>
lesson1 预备知识
查看>>
Copy code from eclipse to word, save syntax.
查看>>
arguments.callee的作用及替换方案
查看>>
23 Java学习之RandomAccessFile
查看>>
SSH远程会话管理工具 - screen使用教程
查看>>
hibernate validation HV000030: No validator could be found for constraint
查看>>
Telink MESH SDK 如何使用PWM
查看>>
LR SP PC
查看>>
C# 图片识别(支持21种语言)【转】
查看>>
jQuery基础教程
查看>>
P2709 小B的询问
查看>>
第三组的抓包作业
查看>>
ILNumerics项目的应用之线性方程
查看>>
django考点
查看>>
python-socket
查看>>
Android中intent如何传递自定义数据类型
查看>>
android基础---->子线程更新UI
查看>>