Xtrareport如何绑定dataSet数据

 时间:2024-10-11 23:09:17

1、report.datasource直接放一个dataset或datatable此种方法在代码里实现,直接为report赋数据源 特点: -无须生成xml -生成模板文件.repx中不包含表结构信息 -可用于特定表的使用,一旦将repx复制到其他地方,则无法根据repx生成表结构

Xtrareport如何绑定dataSet数据

2、XReport代码如下作用就是绑定一下数据XREPORT代码在设计器界面右键显示

Xtrareport如何绑定dataSet数据

3、public XtraReport1(DataTable dt) { InitializeComponent(); this.DataSource = dt; //这里面的Text是xrtable的属性 区分大小写

Xtrareport如何绑定dataSet数据

4、this.xrTableCell1.DataBindings.Add("Text"稆糨孝汶;,dt,"bid"); this.xrTableCell2.DataBindings.Add("Text", dt, "bname"); this.xrTableCell3.DataBindings.Add("Text", dt, "shuoming"); this.xrTableCell4.Text = "编号"; this.xrTableCell5.Text = "名称"; this.xrTableCell6.Text = "备注";

Xtrareport如何绑定dataSet数据

5、private void button1_Click(object sender, EventArgs e) { DataTable dt = new DataTable(); string constr = "server=192.168.100.222;user=sa;pwd=p@ssw1rd;database=pwd1";

Xtrareport如何绑定dataSet数据

6、SqlConnection con = new SqlConnection(constr); try { con.Open(); SqlCommand com = new SqlCommand("select bid,bname,shuoming from book",con); SqlDataAdapter dpt = new SqlDataAdapter(com);

Xtrareport如何绑定dataSet数据

7、dpt.F坡纠课柩ill(dt); XtraReport1 report = new XtraReport1烫喇霰嘴(dt); report.Landscape = true; documentViewer1.DocumentSource = report; report.CreateDocument(); } catch (Exception) { throw; } }

Xtrareport如何绑定dataSet数据
  • PLSQL Developer怎么使用内置HTML阅读器
  • 简单vb语言入门做到用电脑说出你想说的话
  • 使用Notepad++的宏来自动完成重复编辑操作
  • sqlserver数据库日志分离
  • 目前市场三大主流cms对比
  • 热门搜索
    病毒手抄报内容写什么 交通手抄报内容 我的书屋我的梦手抄报 关于法制教育的手抄报 节俭手抄报 中秋节手抄报图画 关于五一的手抄报 爱祖国的手抄报 全国爱眼日手抄报 关于春节的手抄报图片