Converting a Column to an Array

3 posts, 0 answers
  1. Steven
    Steven avatar
    4 posts
    Member since:
    Mar 2016

    Posted 05 Jun Link to this post

    Is there a way to convert a column from your data source to an array/concatenated string?

    To give a little more detail:
    I'm getting back a list of data from my query looking something like this

    1. blah    | x | 1
    2. words | y | 23
    3. hello   | z | 78

    I then need to pass the comma delimited list of column 3 ("1, 23, 78") into a sub-report to be displayed.

     

    Any help would be appreciated. 

  2. Todor
    Admin
    Todor avatar
    175 posts

    Posted 08 Jun Link to this post

    Hello Steven,

    Use AllValues(Expression, IncludeNullValues) Aggregate function to get all values for the current data scope. The Join(separator, strings) Text function can be used to create a string from an array. For example the following expression will return all the 'Name' values from the Report1 data source concatenated with comma:
    = Join(',',Exec('Report1',AllValues(Fields.Name)))

    You can set the DataSource of the subreport to the DataSource of its parent (the main report) through Bindings:
    Property path   |   Expression
    DataSource      |   ReportItem.DataObject
    This way the main report data would be passed dynamically to the subreport, and all the fields will be available there at run time.
    Note that the Fields will not be accessible at design time in the subreport. It will be necessary to type them manually in the expressions.

    Regards,
    Todor
    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. Steven
    Steven avatar
    4 posts
    Member since:
    Mar 2016

    Posted 08 Jun in reply to Todor Link to this post

    That's very helpful and sounds exactly like what I'm trying to do.  Thank you. 
Back to Top