Skip to Content
0
Former Member
Jun 06, 2007 at 04:14 PM

Loading data into Subreport using Datasets

26 Views

I'm having problems loading a report with a subreport. I create a dataset with a range of IDs and a datarange. This data is correctly displayed in the main report. However the subreport always comes up blank, even though the dataset contains the correct information.

The data in the main report is grouped by JobID. The subreport is placed in the footer of the JobID group and takes the JobID as a parameter. The subreport should only show data related to that jobID

I'm not sure what I need to do for the subreport. Below is the code that I have used so far. This results in the blank subreport. The code is written in VB.NET.

Code -


>

dsReportData_Employees = PreloadEmployeeCosts(inJobIDs, inReportRangeTo, inReportRangeFrom, errorMessage)

dsReportData_Materials = PreloadMaterialCosts(inJobIDs, inReportRangeTo, inReportRangeFrom, errorMessage)

crptReport.FileName = "C:\jobcosts.rpt"

crptReport.SetDataSource(dsReportData_Employees.Tables(0))

' This report has a single subreport

crptSubreport = crptReport.OpenSubreport(crptOSLWReport.Subreports(0).Name)

crptSubreport.SetDataSource(dsReportData_Materials.Tables(0))

<----


Code

What do I need to do to get the sub report to actually display data? I am kind of stuck at the moment so any advice or comments would be appreciated.

Regards

Jason