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

Converting a Column to an Array

2 Answers 572 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 05 Jun 2018, 05:06 PM

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 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 08 Jun 2018, 08:43 AM
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
0
Steven
Top achievements
Rank 1
answered on 08 Jun 2018, 12:48 PM
That's very helpful and sounds exactly like what I'm trying to do.  Thank you. 
Tags
General Discussions
Asked by
Steven
Top achievements
Rank 1
Answers by
Todor
Telerik team
Steven
Top achievements
Rank 1
Share this question
or