i have a master detail report that uses a certain table from a DataSet as DataSource,
MasterReport.DataSource = DataSet1.Table1 and
MasterReport.DataMember = "GetEnumerator".
until now, it works fine.
now, i have a subreport in the MasterReport and i want to set its' datasource,
because DataSet1 hold 2 tables, and Table1 is the DataSource of the MasterReport,
i want to take the same DataSet1 and get Table2 from it to put as DataSource of the subreport,
something like that:
((MasterReport.DataSource as DataSet1.Table1).DataSet.Tables["Table2"]
of course this doesn't work because MasterReport.DataSourc is ObjectDataSource type.
how can i do want i need in a better way?
i want the same instance of the Dataset to be the datasource of the two reports but the datamember will be two different tables.
i've attached a screenshot of the way my MasterReport is built.
second problem i have is that i catched in MasterReport this event subReport1_NeedDataSource
(definition of subReport1: "private SubReport subReport1;") and this event MasterReport_NeedDataSource,
i've put a breakpoint in them and it never triggers. any suggestions why that happens?
thanks in advance.