我用VC2003的水晶报表推模式显示时....
老会出现数据库登录.............输入了点确定又登录失败!
public class frmCryWiewer : System.Windows.Forms.Form
{
private CrystalDecisions.Windows.Forms.CrystalReportViewer CryWiewer;
private System.ComponentModel.Container components = null;
public Dataset1 ds=new Dataset1(); //定义了一个Dataset用来共报表绑定数据源
public frmCryWiewer(DataSet ds)//从别的窗体传了一个DataSet过来 是多张表查出的数据
{
InitializeComponent();
this.ds=(Dataset1)ds;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void frmCryWiewer_Load(object sender, System.EventArgs e)
{
myrpt rpt=new myrpt();//这个是报表文件
ReportDocument ReportDoc = new ReportDocument();
rpt.SetDataSource(ds);//ds是构造方法那里赋值的
this.CryWiewer.ReportSource = rpt;
this.CryWiewer.RefreshReport();
}
}
}
{
private CrystalDecisions.Windows.Forms.CrystalReportViewer CryWiewer;
private System.ComponentModel.Container components = null;
public Dataset1 ds=new Dataset1(); //定义了一个Dataset用来共报表绑定数据源
public frmCryWiewer(DataSet ds)//从别的窗体传了一个DataSet过来 是多张表查出的数据
{
InitializeComponent();
this.ds=(Dataset1)ds;
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void frmCryWiewer_Load(object sender, System.EventArgs e)
{
myrpt rpt=new myrpt();//这个是报表文件
ReportDocument ReportDoc = new ReportDocument();
rpt.SetDataSource(ds);//ds是构造方法那里赋值的
this.CryWiewer.ReportSource = rpt;
this.CryWiewer.RefreshReport();
}
}
}