在 FROM 下打开水晶报表文件(代碼碎片)
来源:互联网 发布:mac用flash发热 编辑:程序博客网 时间:2024/05/17 08:48
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Windowsbaobiao
...{
/**//// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form2 : System.Windows.Forms.Form
...{
private System.Windows.Forms.Button btnSelect;
private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form2()
...{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
...{
if( disposing )
...{
if (components != null)
...{
components.Dispose();
}
}
base.Dispose( disposing );
}
Windows Form Designer generated code#region Windows Form Designer generated code
/**//// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
...{
this.btnSelect = new System.Windows.Forms.Button();
this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.SuspendLayout();
//
// btnSelect
//
this.btnSelect.Location = new System.Drawing.Point(20, 9);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(62, 24);
this.btnSelect.TabIndex = 0;
this.btnSelect.Text = "选择文件";
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// crystalReportViewer1
//
this.crystalReportViewer1.ActiveViewIndex = -1;
this.crystalReportViewer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.crystalReportViewer1.Location = new System.Drawing.Point(13, 43);
this.crystalReportViewer1.Name = "crystalReportViewer1";
this.crystalReportViewer1.ReportSource = null;
this.crystalReportViewer1.Size = new System.Drawing.Size(347, 274);
this.crystalReportViewer1.TabIndex = 1;
//
// Form2
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
this.ClientSize = new System.Drawing.Size(366, 322);
this.Controls.Add(this.crystalReportViewer1);
this.Controls.Add(this.btnSelect);
this.Name = "Form2";
this.Text = "WinForm中使用水晶报表查看器";
this.Load += new System.EventHandler(this.Form2_Load);
this.ResumeLayout(false);
}
#endregion
/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
...{
Application.Run(new Form2());
}
private void btnSelect_Click(object sender, System.EventArgs e)
...{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "打开水晶报表文件";
dlg.Filter = "水晶报表文件(*.rpt)|*.rpt|所有文件|*.*";
if(dlg.ShowDialog()==DialogResult.OK)
...{
crystalReportViewer1.ReportSource = dlg.FileName;
}
}
private void Form2_Load(object sender, System.EventArgs e)
...{
}
}
}
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Windowsbaobiao
...{
/**//// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form2 : System.Windows.Forms.Form
...{
private System.Windows.Forms.Button btnSelect;
private CrystalDecisions.Windows.Forms.CrystalReportViewer crystalReportViewer1;
/**//// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form2()
...{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/**//// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
...{
if( disposing )
...{
if (components != null)
...{
components.Dispose();
}
}
base.Dispose( disposing );
}
Windows Form Designer generated code#region Windows Form Designer generated code
/**//// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
...{
this.btnSelect = new System.Windows.Forms.Button();
this.crystalReportViewer1 = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.SuspendLayout();
//
// btnSelect
//
this.btnSelect.Location = new System.Drawing.Point(20, 9);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(62, 24);
this.btnSelect.TabIndex = 0;
this.btnSelect.Text = "选择文件";
this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click);
//
// crystalReportViewer1
//
this.crystalReportViewer1.ActiveViewIndex = -1;
this.crystalReportViewer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.crystalReportViewer1.Location = new System.Drawing.Point(13, 43);
this.crystalReportViewer1.Name = "crystalReportViewer1";
this.crystalReportViewer1.ReportSource = null;
this.crystalReportViewer1.Size = new System.Drawing.Size(347, 274);
this.crystalReportViewer1.TabIndex = 1;
//
// Form2
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
this.ClientSize = new System.Drawing.Size(366, 322);
this.Controls.Add(this.crystalReportViewer1);
this.Controls.Add(this.btnSelect);
this.Name = "Form2";
this.Text = "WinForm中使用水晶报表查看器";
this.Load += new System.EventHandler(this.Form2_Load);
this.ResumeLayout(false);
}
#endregion
/**//// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
...{
Application.Run(new Form2());
}
private void btnSelect_Click(object sender, System.EventArgs e)
...{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Title = "打开水晶报表文件";
dlg.Filter = "水晶报表文件(*.rpt)|*.rpt|所有文件|*.*";
if(dlg.ShowDialog()==DialogResult.OK)
...{
crystalReportViewer1.ReportSource = dlg.FileName;
}
}
private void Form2_Load(object sender, System.EventArgs e)
...{
}
}
}
- 在 FROM 下打开水晶报表文件(代碼碎片)
- 在 WEB下打开水晶报表文件(代碼碎片)
- 在 FROM 下創建主從報表的例子(代碼碎片)
- 在WEB水晶報表查看器上設置ADO.NET報表(代碼碎片)
- 在WEB導出和打印水晶報表(代碼碎片)
- 創建與修改水晶報表(代碼碎片)
- 解决水晶報表登录错误问题(代碼碎片)
- 在ASP.NET下使用水晶报表
- 代碼碎片
- 水晶报表发布的问题:不能正常启动打开报表文件
- 在ASP.NET下使用水晶报表一(零点起步)
- 水晶报表在VC6.0下的使用指南
- 水晶报表在vs2010 WPF环境下的尝试
- CS下在C#里调用显示水晶报表
- .net2005下使用水晶报表
- 水晶报表--excel(下)
- winfrom下使用水晶报表
- VS2010打开水晶报表乱码问题
- java 实现Http代理 (4)
- 浅谈Object Pascal的指针
- SSI有什么用? http://bbs.chinahtml.com/15674
- java 实现Http代理 (5)
- asp.net面试集合
- 在 FROM 下打开水晶报表文件(代碼碎片)
- 日常用品英语翻译
- Linux下的ftp客户端使用笔记
- C#中键盘钩子的使用
- java 实现Http代理 (6)
- (转)用axis2+Tomcat5.5+Eclipse3.2部署和访问Web服务
- 足球笑话
- java 实现Http代理 (7)
- FireFox实用快捷键