Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I pass report names to CR object

Status
Not open for further replies.

TonyScarpelli

Programmer
Jan 23, 2003
361
US
Right now I have something like this in VB .NET:

'Create instance of Display Form
Dim _RepoViewer As New DisplayForm
_RepoViewer.Show()

'-----------------------------------------------
'Crystal Report Variable
Dim oRpt As DeviceList
'Create an instance of the strongly-typed report object
oRpt = New DeviceList
'-----------------------------------------------

'Pass the populated datatable to the report
oRpt.SetDataSource(tblRepoList)

'Set the viewer to the report object to be previewed.
_RepoViewer.CrystalReportViewer1.ReportSource = oRpt

I would like to make this more universal by just passing it the report name. It looks like I need to change

Dim oRpt As DeviceList
oRpt = New DeviceList

into something like

Dim oRpt As myReportName
oRpt = New myReportName

but I don't know how to do this?

Can anyone give me a clue?

Thanks.

Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
dim orpt as object
orpt = new myReportName

take a little more resources(i believe) but it does what you want :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top