Hi there,
I'm using 2 datasources in one report. The first datasource gets the main element and the second the childeren of that element.
Because I couldn't get a table of a list in that datasource I want to get it trough a second call.
If I set the parameter for that datasource as = Field.ItemId it doens't pass along the value of that field to the second DataSource.
How can I do this?
4 Answers, 1 is accepted
When the collection contains objects with inner properties we do not drill down into the hierarchy to reach those inner properties. To use the inner object and its properties you have to bind a separate Data Item to it using expressions and Bindings.
For more detailed information, check Use DataObject as a data source for nested data items (Table, List, Crosstab, Graph) section of the How to use ReportItem.DataObject property in expressions help article and How to Databind to Collection Properties kb article.
If the provided information does not help share some sample data you need to use in report so we can understand the scenario more clearly.
Regards,
Katia
Progress Telerik
Hi Katia,
I am trying to get this working but I can't seem to figure out how this should work. When I try to bind the list to the datasource according to http://www.telerik.com/support/kb/reporting/details/how-to-databind-to-collection-properties It doesn't even get any data anymore.
What am I doing wrong?
[DataObject]
public class TelerikTest
{
public string TestString { get; set; }
public IList<TelerikTestItem> TestItems { get; set; } = new List<TelerikTestItem>();
}
[DataObject]
public class TelerikTestItem
{
public string TestString1 { get; set; }
public string TestString2 { get; set; }
}
I am not sure about the exact settings of the report. You can use the attached sample that demonstrates how to reach the properties of the collection and display their values in the report.
The data object that is used in this sample is very similar to the one you shared.
I hope this will help.
Regards,
Katia
Progress Telerik