您好,
我不知道如果我的查询主题是正确的吗?...
我已创建了21个水晶报表命名GR01_rpt,GR02_rpt,GR03_rpt .... GR021_rpt。 21份报告中,每个人都有自己的格式。
减轻长期的编码,我创建了一个函数,
Public Function A01Control(ByVal txndate As String, ByVal curr_cd As String)
Dim rpt As New GR01_rpt < -- how can i make this variable string
'GR01_rpt is a Crystal Report
'GR01_ds is a DataSet for GR01_rpt
What I wanted to do is, <----------------------
Dim rpt As New xRpt
wherein xRpt can be either GR01_rpt, GR02_rpt GR03_rpt to GR21_rpt, Depending
on What Report the User Processes.
Also, How can i do it in the DataSet <------------------
Dim da As SqlDataAdapter = New SqlDataAdapter(comm)
Dim myDS As New GR01_ds()
da.Fill(myDS, myRPT)
rpt.SetDataSource(myDS)
ReportMain.CrystalReportViewer2.ReportSource = rpt
ReportMain.CrystalReportViewer2.Refresh()
End Function
Hope that my query is right??