如何在asp.net中给VS2005的RDLC报表邦定数据源?

csbenben 2006-05-23 03:17:14
如何在asp.net中给VS2005的RDLC报表邦定数据源?
...全文
258 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
极客行天下 2007-04-01
  • 打赏
  • 举报
回复
http://blog.csdn.net/gaofeng2000/archive/2007/04/01/1548009.aspx
lnwuyaowei 2006-06-10
  • 打赏
  • 举报
回复
up
lnwuyaowei 2006-06-10
  • 打赏
  • 举报
回复
这是VB的,转成c#也很简单.
lnwuyaowei 2006-06-10
  • 打赏
  • 举报
回复
Here's some code that works for me under VS 2005, SQL 2000, and VB.NET CLR 2.0... I hope this helps. -- Walt

Imports Microsoft.Reporting.WebForms
Imports System.Data
Imports SynecticsStandardRoutines

Partial Class _Default
Inherits System.Web.UI.Page

Protected Function GetReportDataSource() As ReportDataSource
Dim ds As New DataSet

' This just populates dataset from SQL Server
Data.ExecuteSQL("SELECT * FROM tblSubm_Log", ds, "DEMO")

' 1st param must be same in report2.rdlc
Return New ReportDataSource("DataSet2_tblSubm_Log", ds.Tables(0))
End Function

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ReportViewer1.LocalReport.ReportPath = "report2.rdlc"
ReportViewer1.LocalReport.DataSources.Add(GetReportDataSource())
End Sub
End Class
lolenboy 2006-06-05
  • 打赏
  • 举报
回复
我也正在用RDLC,多联系,怎么样才能在程序中写代码,动态帮定数据员到 RDLC呢?郁闷,我的MSN:BAOCHUNLV@HOTMAIL.COM/ 有空多联系!我也是刚学,互相学习!

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧