I'm passing data sets for my master and subreport. For each row in master report, the subreport needs to call a procedure using the master row data.
I added NeedDataSource handler in the master report constructor:
then I added NeedDataSource handler function as below:
I have GoalID as a field of master report. How to get the current master row to read the goalID? the sender object in subReport2_NeedDataSource is an instance of SubReport2.
your help is very appreciated!
I added NeedDataSource handler in the master report constructor:
subReport2.NeedDataSource += new EventHandler(subReport2_NeedDataSource);then I added NeedDataSource handler function as below:
private void subReport2_NeedDataSource(object sender, EventArgs e){ //read parent/master row data: int goalID = ??; //how to get the data from the current master row? //get measurements for this goal: System.Data.DataSet ds2 = DataHelper.Measurements_GetMeasurementsForGoal(goalID); var objectDataSource = new ObjectDataSource(); objectDataSource.DataSource = ds2; subReport2.Report.DataSource = objectDataSource;}I have GoalID as a field of master report. How to get the current master row to read the goalID? the sender object in subReport2_NeedDataSource is an instance of SubReport2.
your help is very appreciated!