2

我有 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.nameand做什么rds.value,它都给我留下了

尚未为数据源“dataSetName_TableName”提供数据源实例。

为了让它正常工作,我需要放什么?

4

1 回答 1

1
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 
于 2013-02-02T05:15:09.910 回答