我有2个报告,“report1.rdlc”和“report2.rdlc”。我希望能够在单个报告查看器中交换它们(“rv_1”)。
我还有3个按钮:
确实: btn_1 :
rv_1.LocalReport.ReportEmbeddedResource = "Application1.Report1.rdlc"
rv_1.RefreshReport()
btn_2 :
rv_1.LocalReport.ReportEmbeddedResource = "Application1.Report2.rdlc"
rv_1.RefreshReport()
确实: btn_3
dim rds as new ReportDataSource
rds.name =
rds.value =
rv_1.reset()
rv_1.LocalReport.DataSources.add(rds)
rv_1.RefreshReport()
无论我为rds.name
和rds.value
投放了什么,它都会留给我
尚未为数据源'dataSetName_TableName'提供数据源实例。
我需要做些什么才能使其正常工作?
答案 0 :(得分:0)
Private Sub REPORT1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If CON.State = ConnectionState.Closed Then :
CON.Open() :
End If
CMD.Connection = CON
CMD.CommandText = "SELECT * FROM accounts"
DR = CMD.ExecuteReader
If DR.HasRows Then
Do While (DR.Read)
Me.DataSet1.TblData.AddTblDataRow(DR("FNAME"), DR("LNAME"), DR("MI"))
Loop
End If Me.ReportViewer1.LocalReport.ReportPath = "Report1.rdlc"
Me.ReportViewer1.RefreshReport()
End Sub