在 FROM 下創建主從報表的例子(代碼碎片)
来源:互联网 发布:淘宝男内裤买家秀图片 编辑:程序博客网 时间:2024/05/17 23:40
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
namespace Windowsbaobiao
...{
/**//// <summary>
/// Form3 的摘要描述。
/// </summary>
public class Form3 : System.Windows.Forms.Form
...{
public CrystalReport1 oRpt=null;
private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
/**//// <summary>
/// 設計工具所需的變數。
/// </summary>
private System.ComponentModel.Container components = null;
public Form3()
...{
//
// Windows Form 設計工具支援的必要項
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 呼叫之後加入任何建構函式程式碼
//
}
/**//// <summary>
/// 清除任何使用中的資源。
/// </summary>
protected override void Dispose( bool disposing )
...{
if( disposing )
...{
if(components != null)
...{
components.Dispose();
}
}
base.Dispose( disposing );
}
Windows Form 設計工具產生的程式碼#region Windows Form 設計工具產生的程式碼
/**//// <summary>
/// 此為設計工具支援所必須的方法 - 請勿使用程式碼編輯器修改
/// 這個方法的內容。
/// </summary>
private void InitializeComponent()
...{
this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.SuspendLayout();
//
// crystalReportViewer1
//
this.crystalReportViewer1.ActiveViewIndex = -1;
this.crystalReportViewer1.Location = new System.Drawing.Point(16, 48);
this.crystalReportViewer1.Name = "crystalReportViewer1";
this.crystalReportViewer1.ReportSource = null;
this.crystalReportViewer1.Size = new System.Drawing.Size(864, 552);
this.crystalReportViewer1.TabIndex = 0;
//
// Form3
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
this.ClientSize = new System.Drawing.Size(872, 597);
this.Controls.Add(this.crystalReportViewer1);
this.Name = "Form3";
this.Text = "Form3";
this.Load += new System.EventHandler(this.Form3_Load);
this.ResumeLayout(false);
}
#endregion
private void Form3_Load(object sender, System.EventArgs e)
...{
oRpt=new CrystalReport1();
Dataset1 ds=new Dataset1();
OleDbConnection oleConn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Program Files/Microsoft Visual Studio .NET 2003/Crystal Reports/Samples/Database/cht/xtreme.mdb");
OleDbDataAdapter oleAdapter =new OleDbDataAdapter ("select * from 訂購",oleConn);
oleAdapter.Fill (ds,"訂購");
OleDbDataAdapter oleDetailsAdapter =new OleDbDataAdapter ("select * from 訂貨明細",oleConn);
oleDetailsAdapter.Fill (ds,"訂貨明細");
oRpt.SetDataSource (ds);
this.crystalReportViewer1.ReportSource=oRpt;
}
}
}
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data.OleDb;
using System.Data;
namespace Windowsbaobiao
...{
/**//// <summary>
/// Form3 的摘要描述。
/// </summary>
public class Form3 : System.Windows.Forms.Form
...{
public CrystalReport1 oRpt=null;
private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
/**//// <summary>
/// 設計工具所需的變數。
/// </summary>
private System.ComponentModel.Container components = null;
public Form3()
...{
//
// Windows Form 設計工具支援的必要項
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 呼叫之後加入任何建構函式程式碼
//
}
/**//// <summary>
/// 清除任何使用中的資源。
/// </summary>
protected override void Dispose( bool disposing )
...{
if( disposing )
...{
if(components != null)
...{
components.Dispose();
}
}
base.Dispose( disposing );
}
Windows Form 設計工具產生的程式碼#region Windows Form 設計工具產生的程式碼
/**//// <summary>
/// 此為設計工具支援所必須的方法 - 請勿使用程式碼編輯器修改
/// 這個方法的內容。
/// </summary>
private void InitializeComponent()
...{
this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.SuspendLayout();
//
// crystalReportViewer1
//
this.crystalReportViewer1.ActiveViewIndex = -1;
this.crystalReportViewer1.Location = new System.Drawing.Point(16, 48);
this.crystalReportViewer1.Name = "crystalReportViewer1";
this.crystalReportViewer1.ReportSource = null;
this.crystalReportViewer1.Size = new System.Drawing.Size(864, 552);
this.crystalReportViewer1.TabIndex = 0;
//
// Form3
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
this.ClientSize = new System.Drawing.Size(872, 597);
this.Controls.Add(this.crystalReportViewer1);
this.Name = "Form3";
this.Text = "Form3";
this.Load += new System.EventHandler(this.Form3_Load);
this.ResumeLayout(false);
}
#endregion
private void Form3_Load(object sender, System.EventArgs e)
...{
oRpt=new CrystalReport1();
Dataset1 ds=new Dataset1();
OleDbConnection oleConn=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Program Files/Microsoft Visual Studio .NET 2003/Crystal Reports/Samples/Database/cht/xtreme.mdb");
OleDbDataAdapter oleAdapter =new OleDbDataAdapter ("select * from 訂購",oleConn);
oleAdapter.Fill (ds,"訂購");
OleDbDataAdapter oleDetailsAdapter =new OleDbDataAdapter ("select * from 訂貨明細",oleConn);
oleDetailsAdapter.Fill (ds,"訂貨明細");
oRpt.SetDataSource (ds);
this.crystalReportViewer1.ReportSource=oRpt;
}
}
}
- 在 FROM 下創建主從報表的例子(代碼碎片)
- 在 FROM 下打开水晶报表文件(代碼碎片)
- 代碼碎片
- 在 WEB下打开水晶报表文件(代碼碎片)
- 在WEB水晶報表查看器上設置ADO.NET報表(代碼碎片)
- 在WEB導出和打印水晶報表(代碼碎片)
- 老年代碎片化问题. java5的改进.
- 創建與修改水晶報表(代碼碎片)
- 解决水晶報表登录错误问题(代碼碎片)
- IP碎片攻击例子
- 递归和迭代的小例子
- Activity与在Android的碎片Fragment
- 在MStar的LTE研发记忆碎片
- IP碎片攻击例子2
- javascript之文档碎片,文档碎片在理论上可以提高DOM操作的执行效率
- 你以为你在利用碎片化时间,实际上你的时间被碎片化了
- struts2中的迭代标签的用法与例子
- struts2中的迭代标签的用法与例子
- asp遇到的小问题
- POSTGRESQL 让客户端互相通信
- IBM Tivoli Storage Manager安装介绍
- 构架师已死
- HTTP常见错误代码释义
- 在 FROM 下創建主從報表的例子(代碼碎片)
- 需求跟踪系列 I - 入门篇
- 打包Jar文件(例子)
- 的问题
- linux socke编程实例:一个简单的echo服务器程序
- sizeof 操作符及pragma内存对齐
- 清除恶意木马qhbpri.dll木马群
- 内存调试技巧
- vc简单的窗口类