TableLogOnInfo logOnInfo = new TableLogOnInfo ();
//这里必须事先申明一个ReportDocument对象 Report,同时加载数据报表
ReportDocument oRpt = new ReportDocument();
//获取.rpt文件真实路径
string path1,path2;
path1= ("F:\\TGHL3");
path2=path1+"\\ssfa_rwb.rpt";
oRpt.Load (path2);
oRpt.Load ("F:\\TGHL3\\ssfa_rwb.rpt");
crystalReportViewer1.ReportSource = oRpt;
//这里必须事先申明一个ReportDocument对象 Report,同时加载数据报表
ReportDocument oRpt = new ReportDocument();
//获取.rpt文件真实路径
string path1,path2;
path1= ("F:\\TGHL3");
path2=path1+"\\ssfa_rwb.rpt";
oRpt.Load (path2);
oRpt.Load ("F:\\TGHL3\\ssfa_rwb.rpt");
crystalReportViewer1.ReportSource = oRpt;
解决方案 »
- c#结构体里的数组赋值问题
- c# 怎么实现像百度收索那样的文本拖放功能
- 安装vs2008sp1补丁时出现问题
- C# WinForm中窗体控件缩放的问题
- 有关DirectShow多倍快过的问题
- 关于C#调用JS出现的问题
- 在winform中绑定checkedlistbox的问题
- 新菜鸟求助!
- 高分请教源代码分析的问题!在线等待ing
- 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。
- 看了 Petshop 3.0 几个文件 , 如 DataProtector.cs , 信心一下子全没有了,太难懂了 , 高手 指点 !!! up 有分 ----
- 本人家中光景一日不如一日,想外接一些软件业务。详细请进。谢谢!
//再将这个报表对象赋给一个CrystalReportViewer,就可以
DataSet dsdataSet =new DataSet();
SqlConnection scn=new SqlConnection (DataConnString);
scn.Open();
SqlDataAdapter sdaXReport;Rpt_X oRpt_1 =new Rpt_X(); // Rpt_X 设计好的报表名
sdaXReport=new SqlDataAdapter(pCommandText,scn);
sdaXReport.Fill(dsdataSet,"table");
//使用“报表引擎”对象模型将填充的数据集,传递给报表oRpt_1.SetDataSource(dsdataSet.Tables["table"]);rpt.ReportSource = oRpt_1; //rpt 为 CrystalReportViewer
rep.SetDataSource(ds)
int intPrintCount=1;
int intPrintStartPage=0;
int intPrintEndPage=0;
rep.PrintOptions.PrinterName="打印机名"
rep.PrintToPrinter(intPrintCount,false,intPrintStartPage,intPrintEndPage);