Private Function GetMyData() As ReportDataSource
'establish an instance of the web service
Dim rs As LocalReportSample.mySampleWebService.ReportService
rs = New ReportService()
'create a new array for the data that is returned
Dim dataList() As ReportSummaryMsg
'assign the array to the results of the web service method
dataList = rs.MyWebServiceMethod()
'instantiate the ObjectArray which will convert the array returned from the web service to a DataSet
Dim objectArray As New ObjectArray(dataList)
'create a new DataSet
Dim ds As New DataSet()
'use the ObjectArray to convert the array to a DataSet
' (this is needed because the ReportDataSource must be a Table)
ds = objectArray.ToDataSet()
'return the ReportDataSource
' The string value must be the same name as the report's datasource (go to Report -> DataSources to see this name)
' The table is from the the DataSet.
Return New ReportDataSource("LocalReportSample_mySampleWebService_ReportSummaryMsg", ds.Tables(0))
End Function 'GetMyData