第一步: 在工程中创建一个名为 PageReport_DataSource_MultiSources.rdlx 的页面报表
第二步:从Visual Studio菜单栏中的“视图”->“其他窗口”->“报表资源管理器 V9”中打开ActiveReports报表资源管理器
第三步:在“DataSource1”节点上点击鼠标右键,选择“添加数据集”菜单项,在d出对话框的“查询”选项卡中写入以下SQL查询语句 [Select * from 类别]
详细的 *** 作步骤,请参考下面的博客http://blog.gcpowertools.com.cn/post/2014/08/04/ActiveReports_DataSource_MultiSources.aspx
可以这样添加rdlc ,下面为部分关键代码,看了就懂 我的是C#的,思路就是这样if (ds.Tables[0].Rows.Count >0)
{
labmsg.Text = ds.Tables[0].Rows.Count.ToString()
ReportDataSource rds = new ReportDataSource("DataSet1", ds.Tables[0])
ReportViewer1.LocalReport.DataSources.Clear()
ReportViewer1.LocalReport.DataSources.Add(rds)
ReportViewer1.LocalReport.ReportPath = "rdl\\YP\\rdlwtdataquery.rdlc"
ReportViewer1.LocalReport.Refresh()
}
else
{
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)