Page 1 of 1
Accessing other data source from data band
Posted: Mon Oct 20, 2008 6:34 am
by ColinM
Hi,
For each row of data printed in a data band (for data source X), I need to look up a row in data source Y. My question is, is it possible to add a function to the BeforePrintEvent of the data band (X) which will return data from Y? To do this, I will need to filter Y by a key value from X - can I access rows / filter an STI data source using ADO.NET type methods?
Thanks,
Colin
Accessing other data source from data band
Posted: Mon Oct 20, 2008 2:24 pm
by Edward
Hello, Colin.
If it is possible you can create a relation between datasources (if they are from different datasources then you have to set Report.CacheAllData property in true).
Work on the ADO.Net level is also possible. Each DataSource has DataTable property which represents ADO.Net standard DataTable object and this DataTable contains all the data of that DataSource.
Thank you.
Accessing other data source from data band
Posted: Tue Oct 21, 2008 3:17 am
by ColinM
Thank you Edward, I will give this a try.
Colin
Accessing other data source from data band
Posted: Thu Oct 30, 2008 4:17 am
by ColinM
Hi,
In the code for the mrt I have the following:
Dim dtLevel As Data.DataTable
Dim drRows() As Data.DataRow
dtLevel = Level.DataTable
drRows = dtLevel.Select("levelName = 'XXX'")
The business object data source is 'Level'. The assignment to dtLevel works ok, however, the mrt is falling over on the final dtLevel.Select line. The column name is definately correct. Could you tell me where I am going wrong here please?
Thanks,
Colin
Accessing other data source from data band
Posted: Thu Oct 30, 2008 6:45 pm
by Edward
Hi, Colin.
Your steps are absolutely correct. If you have no idea what is wrong, feel free to submit your application and data for it to support[at]stimulsoft.com.
Thank you.
Accessing other data source from data band
Posted: Fri Oct 31, 2008 3:32 am
by ColinM
Hi Edward,
I stored the exception message in a variable which I then displayed in a text box in the report, and the problem was that the column name could not be found. The column name is definately correct, so I set the text box to display the column names from the 'Level' datatable. Much to my surprise, the 'Level' datatable contains column names for a completely different data source, the 'Vendors' business object data source.
How is it possible for the datatable for data source X to contain column names for data source Y, and how can I correct this?
Many thanks,
Colin
Accessing other data source from data band
Posted: Fri Oct 31, 2008 3:37 am
by Edward
Hello, Colin.
Could you please send this report to support[at]stimulsoft.com for analysis.
Thank you.
Accessing other data source from data band
Posted: Fri Oct 31, 2008 3:56 am
by ColinM
OK, will do.
Thanks,
Colin