CrystalReport1.rpt ,DataSet.xsd,crystalReportViewer1水晶报表,以及向文本框对...
OleDbConnection Con = null; string strCon = null; OleDbCommand Cmd = null; strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\Administrator\\桌面\\江大软件\\28.mdb"; Con = new OleDbConnection(strCon);//建立连接 string strSql = "select * from BZData where GroupID='1214015'";//表名的写法也应注意不同,对应的excel表为sheet1,在这里要在其后加美元符号$,并用中括号 Cmd = new OleDbCommand(strSql, Con);//建立要执行的命令 OleDbDataReader read = null; DataSet ds = new DataSetshujuji(); try { Con.Open(); //从命令对象中读取数据 read = Cmd.ExecuteReader(); //有了ADO.NET,可把读取来的数据直接加载到数据集中 ds.Tables[0].Load(read); read.Close(); Con.Close(); //为查看器提供本地报表数据 CrystalReport1 cry = new CrystalReport1();((TextObject)cry.ReportDefinition.ReportObjects["Text12"]).Text = "sdsad"; //ParameterRangeValue cry.SetDataSource(ds); crystalReportViewer1.ReportSource = cry; } catch (Exception ex) { } } } }
- 1
- 粉丝: 1
- 资源: 6
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
- 1
- 2
- 3
前往页