Xtrareport 多栏报表
首先看下布局designer
细节:
分组一定要用到GroupHeather
设置好有 右边会出现
接下来是代码部分
Form1中代码
using DevExpress.XtraReports.UI; private DataSet getds()
{ DataSet ds = new DataSet();
string constr = "server=192.168.100.222;user=sa;pwd=p@ssw1rd;database=pwd1";
SqlConnection mycon = new SqlConnection(constr); try
{
mycon.Open();
SqlCommand mycom = new SqlCommand("select * from mulittb", mycon);
SqlDataAdapter dpt = new SqlDataAdapter(mycom);
dpt.Fill(ds, "mulittb");
mycon.Close(); }
catch (Exception ex)
{ MessageBox.Show(ex.Message);
} return ds;
}
//显示
private void simpleButton1_Click(object sender, EventArgs e)
{
DataSet ds = getds();
XtraReport1 report = new XtraReport1(ds);
report.Landscape = true;
documentViewer1.DocumentSource = report;
report.CreateDocument();
}
//预览
private void simpleButton2_Click(object sender, EventArgs e)
{
DataSet ds = getds();
XtraReport1 report = new XtraReport1(ds);
report.Landscape = true;
report.ShowPreviewDialog();
}
Xtrareport代码
public XtraReport1(DataSet ds)
{
InitializeComponent();
this.DataSource = ds;
this.DataMember = "mulittb";
xrTableCell1.DataBindings.Add("Text",ds,"type");
//设置groupHeader分组字段 (type ,报表列 排序类型.上升asc) 可以不写
GroupField fz = new GroupField("type",XRColumnSortOrder.Ascending);
//把分组字段添加进GroupHeader1
((GroupHeaderBand)(this.FindControl("GroupHeader1", true))).GroupFields.Add(fz);
//绑定显示多列的字段
this.xrTableCell2.DataBindings.Add("Text",ds,"name"); }
Xtrareport 多栏报表的更多相关文章
- [原创]Devexpress XtraReports 系列 4 创建多栏报表
昨天我们完成了 [原创]Devexpress XtraReports 系列 3 创建主从报表 今天我们继续学习新的一种报表模式:多栏报表.(Demo源码,数据库最后附上) 或许很多人会问什么是多栏报表 ...
- Devexpress Xtrareports 创建多栏报表
根据官方回答:多列或多行(取决于当前的多栏设置)呈现数据的报表 这种报表是有用的,例如,当每个明细区都只显示少量数据.并且需要在一列的右侧打印下一个明细区时,这样就能充分利用整个页面的宽度,此外,当创 ...
- ActiveReports 报表应用教程 (4)---分栏报表
在 ActiveReports 中可以实现分栏报表布局样式,可以设置横向分栏.纵向分栏,同时进行分栏和分组设置,统计分栏分组的小计.合计等.在商业报表系统中常见的分栏报表有商品标签.员工工卡.条码打印 ...
- FastReport.Net使用:[9]多栏报表(多列报表)
方法一:使用页的列属性(Page Columns) 1.绘制报表标题 2.设置页的列数量为3,其他默认不变.报表设计界面便如下呈现. 3.报表拷贝前面[分组]报表的内容. 4.就这么简单,一张多栏报表 ...
- Devexpress Xtrareport 创建主从报表
效果 xtrareport 布局 From 代码 private DataSet Getdata() { DataSet ds = new DataSet(); //config配置字符串 strin ...
- Xtrareport 报表的一些属性及控件
基本概念: XtraReports 中的每个报表都由 XtraRepot 类的一个实例表示,或者由该类的子类来表示(这种情况更常见). 因此,每个报表都作为带区的容器使用,而每个带区中都包含报表控件. ...
- 关于devexpress报表XtraReport,动态修改报表样式(.repx格式),动态添加数据并使用的理解
一.基本概念: XtraReports 中的每个报表都由 XtraRepot 类的一个实例表示,或者由该类的子类来表示(这种情况更常见). 因此,每个报表都作为带区的容器使用,而每个带区中都包含报表控 ...
- [原创]Devexpress XtraReports 系列 5 创建交叉报表
昨天我们已经介绍了如何创建多栏报表,详见:[原创]Devexpress XtraReports 系列 4 创建多栏报表 今天我们继续我们的XtraReports系列.Demo和数据库文件最后会附上. ...
- Devexpress XtraReports 交叉报表
[原创]Devexpress XtraReports 系列 5 创建交叉报表 昨天我们已经介绍了如何创建多栏报表,详见:[原创]Devexpress XtraReports 系列 4 创建多栏报表 ...
随机推荐
- 自定义非等高 Cell
1.自定义非等高 Cell介绍 1.1 代码自定义(frame) 新建一个继承自 UITableViewCell 的类. 重写 initWithStyle:reuseIdentifier: 方法. 添 ...
- How to compile a node file?如何编译一个节点文件?
Ubuntu16.04,ros Kinetic 最近几次遇到的问题都是,给你一个写好的ros node文件,没有给你其他的东西,你如何编译它? 以从ros中提取rgb图像和深度图像为例,示例源代码ex ...
- Unity苹果(iOS)内购接入(Unity内置IAP)
https://www.jianshu.com/p/4045ebf81a1c Unity苹果(iOS)内购接入(Unity内置IAP) Kakarottog ...
- kuangbin专题16I(kmp)
题目链接: https://vjudge.net/contest/70325#problem/I 题意: 求多个字符串的最长公共子串, 有多个则输出字典序最小的. 思路: 这里的字符串长度固定为 60 ...
- luogu3911 最小公倍数之和(莫比乌斯反演)
link 给定\(A_1,A_2,\dots,A_N\),求\(\sum_{i=1}^N\sum_{j=1}^Nlcm(A_i,A_j)\) \(1\le N\le 50000;1\le A_i\le ...
- luogu2658 GCD(莫比乌斯反演/欧拉函数)
link 给定整数N,求1<=x,y<=N且Gcd(x,y)为素数的数对(x,y)有多少对. 1<=N<=10^7 (1)莫比乌斯反演法 发现就是YY的GCD,左转YY的GCD ...
- deque时间复杂度和vector,list比较
deque supports const time insert and erase operations at the beginning or the end, insert or erase i ...
- socket 中read返回0的情况
当client,调用read(socketfd,buffer,n)时,返回0的情况: 1.server端调用了close(soketfd)函数 2.server调用了close(fd,SHUT_WR) ...
- uwsgi01---uwsgi文件
1. 安装 pip install uwsgi //测试uWSGI是否安装成功 在终端中输入以下命令查看uwsgi的版本:uwsgi --version 2.简单运行 运行uwsgi:uwsgi -- ...
- [转]Groovy Goodness
http://mrhaki.blogspot.com/2014/12/gradle-goodness-continue-build-even.html 介绍了不少使用Groovy编写脚本的好例子,可以 ...