Page 1 of 1

Multiple Objects in 1 Textbox?

Posted: Tue Feb 27, 2024 2:46 am
by ericp
I was wondering if it's possible to have multiple objects in 1 textbox that are comma separated?

For example, I'm creating an excel report and one of my cells wants to have a list of all of the LocationType in my JSON object. So as opposed to creating a report that has 2 different cells (one of each LocationType). It would be 1 textbox, that lists both LocationTypes at once.

For example: instead of a textbox for "Interchange", and then another for "Point Location", this one textbox will say "Interchange, Point Location"

Re: Multiple Objects in 1 Textbox?

Posted: Tue Feb 27, 2024 10:53 pm
by Lech Kulikowski
Hello,

You can use the string the JoinColumnContent function:

JoinColumnContent(object dataSource, string columnName, string delimiter)
Writes all the values of the data source column through the separator as a string.

Thank you.

Re: Multiple Objects in 1 Textbox?

Posted: Wed Feb 28, 2024 10:27 pm
by ericp
Hi @Lech,

I'm having some difficulty understanding that function. If I want a list of all of the LocationTypes separated by a comma, would my function look like:

JoinColumnContent(Projects_CurrentProjectRevision_LocationDetails.LocationType, "LocationType", ",").

Re: Multiple Objects in 1 Textbox?

Posted: Thu Feb 29, 2024 10:57 am
by Lech Kulikowski
Hello,

Should be:
JoinColumnContent(Projects_CurrentProjectRevision_LocationDetails, "LocationType", ",")

Thank you.

Re: Multiple Objects in 1 Textbox?

Posted: Fri Mar 01, 2024 5:34 pm
by ericp
Hi Lech, I made a simple Sample report just trying to get all of my ProjectIDs, but it does not seem to be working. Could you please assist? Thank you!

Re: Multiple Objects in 1 Textbox?

Posted: Mon Mar 04, 2024 8:54 am
by Lech Kulikowski
Hello,

All expressions in the Text components should be in curly brackets:
{JoinColumnContent(Projects_CurrentProjectRevision, "ClientProjectId", ",")}

Thank you.

Re: Multiple Objects in 1 Textbox?

Posted: Tue Mar 05, 2024 9:42 pm
by ericp
Hi Lech, thank you for responding. That solution seemed to work for basic databands, but I'm running into issues when I use groupheaderbands. In the screenshot, I know that the first line project CC20130027 has 2 LocationTypes: "N/A" and "Hwy Segment".

I am able to get both of these to show if I use a normal databand, but in this case where I'm trying to create a groupheaderband I am unable to get the values to show. I've linked my mrt file and put the last 2 columns as the testing columns. The reason I'm using a groupheaderband is because I essentially need to put 3 objects worth of data in my JSON onto 1 single line to make a spreadsheet.

Please advise

Re: Multiple Objects in 1 Textbox?

Posted: Tue Mar 05, 2024 10:40 pm
by Lech Kulikowski
Hello,

The JoinColumnContent joins all values from the data source and is not depended on any band.

Thank you.

Re: Multiple Objects in 1 Textbox?

Posted: Wed Mar 06, 2024 4:35 am
by ericp
Could you take a look at the MRT file that I attached. I have tried many variations, but unable to get the JoinColumnContent expression to work for Groupheaderbands

Re: Multiple Objects in 1 Textbox?

Posted: Wed Mar 06, 2024 7:48 am
by Lech Kulikowski
Hello,

Once again - JoinColumnContent joins all values from the data source, it is not possible to join values only by groups with the JoinColumnContent function.

As a way, you can try to use the Cross-Data component.

Thank you.