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

5 posts, 0 answers
  1. Robin
    Robin avatar
    4 posts
    Member since:
    Jun 2017

    Posted 01 Aug Link to this post

    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?

     

     

  2. Katia
    Admin
    Katia avatar
    566 posts

    Posted 03 Aug Link to this post

    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
  3. Robin
    Robin avatar
    4 posts
    Member since:
    Jun 2017

    Posted 04 Sep in reply to Katia Link to this post

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

  4. Robin
    Robin avatar
    4 posts
    Member since:
    Jun 2017

    Posted 04 Sep Link to this post

    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.
  5. Katia
    Admin
    Katia avatar
    566 posts

    Posted 05 Sep Link to this post

    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
Back to Top