This is a migrated thread and some comments may be shown as answers.

How can I set a field as a parameter for another datasource?

4 Answers 272 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 01 Aug 2017, 07:34 AM

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

Sort by
0
Katia
Telerik team
answered on 03 Aug 2017, 12:15 PM
Hello Robin,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Robin
Top achievements
Rank 1
answered on 04 Sep 2017, 02:22 PM

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; }
}

0
Robin
Top achievements
Rank 1
answered on 04 Sep 2017, 02:51 PM
What I am trying is to set the first fields in the report as textboxes with TelerikTest and then I want to show the list in a table of the elements TelerikTestItem.
0
Katia
Telerik team
answered on 05 Sep 2017, 12:18 PM
Hello Robin,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report Designer (standalone)
Asked by
Robin
Top achievements
Rank 1
Answers by
Katia
Telerik team
Robin
Top achievements
Rank 1
Share this question
or