如何动态定义水晶报表的格式,而不是通过水晶报表的设计器 关注!!!我也有这样的问题。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <转>水晶报表参数 作者: csdn 类别: C#/VB 日期: 2003-6-9 20:04:18 CrystalDecisions.Shared.ParameterValues pvCollection=new CrystalDecisions.Shared.ParameterValues();CrystalDecisions.Shared.ParameterDiscreteValue pdvCustomerName=new CrystalDecisions.Shared.ParameterDiscreteValue();CrystalDecisions.Shared.TableLogOnInfo tliCurrent;ReportDocument rptCustomersOrders = new ReportDocument(); try{rptCustomersOrders.Load("D:\\My Music\\WindowsApplication1\\CrystalReport1.rpt");foreach(CrystalDecisions.CrystalReports.Engine.Table tbCurrent in rptCustomersOrders.Database.Tables){tliCurrent = tbCurrent.LogOnInfo;tliCurrent.ConnectionInfo.ServerName ="localhost";tliCurrent.ConnectionInfo.UserID ="sa";tliCurrent.ConnectionInfo.Password ="";tliCurrent.ConnectionInfo.DatabaseName ="Northwind";tbCurrent.ApplyLogOnInfo(tliCurrent); }pdvCustomerName.Value = this.comboBox1.Text; pvCollection.Add(pdvCustomerName); rptCustomersOrders.DataDefinition.ParameterFields["@customerid"].ApplyCurrentValues(pvCollection);this.crystalReportViewer1.ReportSource= rptCustomersOrders;} catch( LoadSaveReportException exp){this.label1.Text=exp.Message;}//catch (Exception en)//{this.label2.Text=en.Message;} winform中Combobox模糊下拉 项目可行性研究 求高手:c#水晶报表如何指定打印机和纸张大小 求助:有关Lable的显示问题!~! 按经纬度把.gst文件切割成图片 设置自定义控件(Com组件)的图标 数据备份和数据恢复? 取本计算本的名称: 如何用c#操作pagemaker啊 c# 禁止同時打開同一窗體?? 怎样连接 有密码的 *.mdb数据库?? 一个在调用文件时遇到的问题(知情者帮帮忙)
作者: csdn 类别: C#/VB 日期: 2003-6-9 20:04:18
CrystalDecisions.Shared.ParameterValues pvCollection=new CrystalDecisions.Shared.ParameterValues();
CrystalDecisions.Shared.ParameterDiscreteValue pdvCustomerName=new CrystalDecisions.Shared.ParameterDiscreteValue();
CrystalDecisions.Shared.TableLogOnInfo tliCurrent;
ReportDocument rptCustomersOrders = new ReportDocument();
try
{
rptCustomersOrders.Load("D:\\My Music\\WindowsApplication1\\CrystalReport1.rpt");
foreach(CrystalDecisions.CrystalReports.Engine.Table tbCurrent in rptCustomersOrders.Database.Tables)
{
tliCurrent = tbCurrent.LogOnInfo;
tliCurrent.ConnectionInfo.ServerName ="localhost";
tliCurrent.ConnectionInfo.UserID ="sa";
tliCurrent.ConnectionInfo.Password ="";
tliCurrent.ConnectionInfo.DatabaseName ="Northwind";
tbCurrent.ApplyLogOnInfo(tliCurrent);
}
pdvCustomerName.Value = this.comboBox1.Text;
pvCollection.Add(pdvCustomerName);
rptCustomersOrders.DataDefinition.ParameterFields["@customerid"].ApplyCurrentValues(pvCollection);
this.crystalReportViewer1.ReportSource= rptCustomersOrders;
}
catch( LoadSaveReportException exp)
{this.label1.Text=exp.Message;}
//catch (Exception en)
//{this.label2.Text=en.Message;}