XtraReport 添加空行的办法,很详细
这两天为了做报表,研究了一下XtraReport 。为了添加空行,想了很多办法。其中如果有分组时,网上给出的办法就会失败。
现将经验公布一下,希望各位都能少走弯路。
1.加入自定义函数CreateCellArray,用于创建空行。
2.生成报表的 FillEmptySpace 事件,填写如下代码。
3.tableDetail 是指细节 区带
4.****注意,如果有分组,必须将分组PrintAtBottom设置为true,就是将其下沉。
private void CreateCellArray(XRTableRow xrRow, XRTableRow xrRowTemplate)
{
int Xmargin = 0;
for (int i = 0; i < xrRowTemplate.Cells.Count; i++)
{
XRTableCell xrcell = new XRTableCell();
xrcell.BorderWidth = 1;
xrcell.Borders = (DevExpress.XtraPrinting.BorderSide)((BorderSide.Left | BorderSide.Right) | BorderSide.Bottom);
xrcell.WidthF = xrRowTemplate.Cells.WidthF;
xrcell.BackColor = xrRowTemplate.Cells.BackColor;
xrcell.Height = xrRowTemplate.Height;
if (i != 0)
{
xrcell.Location = new Point(Convert.ToInt32(Xmargin + xrRowTemplate.Cells.WidthF), 0);
}
else
{
xrcell.Location = new Point(0, 0);
}
xrRow.Cells.Add(xrcell);
}
}
private void XR_HT_RT_FillEmptySpace(object sender, BandEventArgs e)
{
XRTable table = tableDetail;//Template Detail Band XRTable
int iheight = table.Rows[table.Rows.Count - 1].Height;
XRTable xrTable = new XRTable();
xrTable.Size = new Size(table.Width, e.Band.Height - 1);
xrTable.BorderWidth = table.BorderWidth;
xrTable.Location = table.Location;
xrTable.BackColor = table.BackColor;
int SpaceRowCount = e.Band.Height / iheight;
XRTableRow[] xrRow = new XRTableRow[SpaceRowCount];
if (SpaceRowCount > 0)
{
for (int i = 0; i < SpaceRowCount; i++)
{
xrRow = new XRTableRow();
xrRow.Size = new Size(table.Width, iheight);
xrRow.Location = new Point(table.Location.X, i * iheight);
xrRow.Borders = (DevExpress.XtraPrinting.BorderSide)((BorderSide.Left | BorderSide.Right) | BorderSide.Bottom);
xrRow.BorderWidth = 1;
xrRow.BorderColor = table.Rows[table.Rows.Count - 1].BorderColor;
//CreateCell
XRTableRow row = table.Rows[table.Rows.Count - 1];
CreateCellArray(xrRow, row);
}
xrTable.Rows.AddRange(xrRow);
e.Band.Controls.Add(xrTable);
}
}
XtraReport 添加空行的办法,很详细的更多相关文章
- 很详细、很移动的Linux makefile教程:介绍,总述,书写规则,书写命令,使用变量,使用条件推断,使用函数,Make 的运行,隐含规则 使用make更新函数库文件 后序
很详细.很移动的Linux makefile 教程 内容如下: Makefile 介绍 Makefile 总述 书写规则 书写命令 使用变量 使用条件推断 使用函数 make 的运行 隐含规则 使用m ...
- [转]很详细的devexpress应用案例
很详细的devexpress应用案例,留着以后参考. 注:转载自http://***/zh-CN/App/Feature.aspx?AppId=50021 UPMS(User Permissions ...
- C++内存管理(超长,例子很详细,排版很好)
[导语] 内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的检查代码和对C++的痛恨,但内存管理在C++中无处不 ...
- 很详细的SpringBoot整合UEditor教程
很详细的SpringBoot整合UEditor教程 2017年04月10日 20:27:21 小宝2333 阅读数:21529 版权声明:本文为博主原创文章,未经博主允许不得转载. https: ...
- 讲的很详细的一篇关于object equals() & hashCode() 的文章
转: 讲的很详细的一篇关于object equals() & hashCode() 的文章 哈希表这个数据结构想必大多数人都不陌生,而且在很多地方都会利用到hash表来提高查找效率.在Java ...
- SecureCRT的安装与破解(过程很详细!!!)
SecureCRT的安装与破解(过程很详细!!!) 使用SecureCRT可以方便用户在windows环境下对linux主机进行管理,这里为大家讲一下SecureCRT的破解方法,仅供大家参考学习: ...
- ETL讲解(很详细!!!)
ETL讲解(很详细!!!) ETL是将业务系统的数据经过抽取.清洗转换之后加载到数据仓库的过程,目的是将企业中的分散.零乱.标准不统一的数据整合到一起,为企业的决策提供分析依据. ETL是BI项目重要 ...
- 00-01.PHP 网站假设win7配置自己的IIS服务器亲自做的图文很详细 [转 - 赞 ]
win7配置自己的IIS服务器亲自做的图文很详细 分步阅读 跟人网站爱好初学者必看的win7系统配置自己的IIS,可以在你自己的电脑上配置网站服务器发不到网上,下面就跟着我的步骤一起做吧100%成功. ...
- 在MyEclipse(2015)中上传项目到github的步骤(很详细)
(图文)在MyEclipse(2015)中上传项目到github的步骤(很详细) git|smartGit使用详解 SmartGit使用教程
随机推荐
- python download
今天下载 python3 , 从官网下 速度 平均 十几K,网上 搜了下.提供的下载地址 几乎都是 官网的. 于是 下了个 百度同步盘,做 公开分享. 提供给 大家下载,速度 有 300 多K,提高了 ...
- messagePaneHost
Microsoft.Dynamics.Framework.UI.WinForms.Controls.MessageBarType messageBarType; super(); imageList ...
- (转)You might not need jQuery
You might not need jQuery You certainly can support IE 9 and below without jQuery, but we don't. Ple ...
- JS-为金额添加千分位逗号分割符
前言:这个功能在前端页面中使用的还是比较多的,正好我们的项目中也有使用此功能,不过YY同学写的代码不像个方法的样子,一个入口中间又插了几道子,所 以,我写了下面这个方法,经过测 ...
- jquery 城市三级联动
js代码 /*城市三级联动 * @method cityChange * @param allProvince,allCity,allDistrict */ function cityChange(p ...
- Robot Framework:RF中对时间操作的datetime库常用关键字
[转自:http://blog.csdn.net/r455678/article/details/52993765] 1.对固定日期进行操作,增加或减去单位时间或者时间段 2.对两个时间段进行操作 3 ...
- C#打开文件对话框
OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = System.Environment.CurrentDirector ...
- Windows程序设再读笔记03-窗口与消息
1.关于LoadIcon/LoadCursor,这两个函数,第一个参数为实例句柄,如果是从保存在磁盘中的可执行文件中加载资源,则需要则需要指定可执行文件的hInstance,如果是系统资源,该句柄为N ...
- 转 LoadRunner 技巧之协议分析
在做性能测试的时候,协议分析是困扰初学者的难题,选择错误的协议会导致Virtual User Generator 录制不到脚本:或录制的脚本不完整,有些应用可能需要选择多个协议才能完整的记录 客户端与 ...
- AngularJS 2 Typescript 相关
1. Angular 2 In 60 Minutes (2016年11月23日) https://www.youtube.com/watch?v=-zW1zHqsdyc 2. AngularJS Cl ...