how do i get multiple rows output as comma separated items on one line?

Stimulsoft Reports.WPF discussion
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

how do i get multiple rows output as comma separated items on one line?

Post by Alex K. »

Hello,

In this function the third parameter is delimiter. You can use the following expression:

Code: Select all

{Func.EngineHelper.JoinColumnContent(Categories, "CategoryName", "; ")}
Thank you.
JorisWils
Posts: 86
Joined: Tue Jun 30, 2009 7:49 am
Location: belgium

how do i get multiple rows output as comma separated items on one line?

Post by JorisWils »

yeah okay.. I explained it incorrectly I think

I mean.... In the complete text being generated... Diffrent delimiters should be used based on a condition.

So I can have dots, kommas and ";" in the complete text.

maybe something like:

Code: Select all

Func.EngineHelper.JoinCollumnContent.AddCondition(CollumnName,ValueToCheck, ColumnToPrint ,delimitor)
example:

Code: Select all

Func.EngineHelper.JoinCollumnContent.AddCondition("CategoryName","Cat","Species",";") --> delimiter ";" would be printed after the value has been printed
Func.EngineHelper.JoinCollumnContent.AddCondition("CategoryName","Dog","Species",".") --> delimiter "." would be printed after the value has been printed
Func.EngineHelper.JoinCollumnContent.AddCondition("CategoryName","Bird","Species",",")--> delimiter "," would be printed after the value has been printed

So if we have a table:

Code: Select all

----------------------------------
| CategoryName | Species   |
----------------------------------
| Cat          | Kitten    |
| Dog          | Labrador  |
| Bird         | Parrot    |
----------------------------------

The output would then be:

Code: Select all

"kitten; Labrador. Parrot, "
Using Stimulsoft since 2007
q123
Posts: 10
Joined: Tue Feb 28, 2012 9:02 am

how do i get multiple rows output as comma separated items on one line?

Post by q123 »

Hi Aleksey,

Thanks for adding this in. The simple version should suffice for my situation and is a lot easier. Our support team and myself appreciate your efforts. Looking forward to trying it.

Regards
Martin
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

how do i get multiple rows output as comma separated items on one line?

Post by Alex K. »

Hello,
JorisWils wrote:yeah okay.. I explained it incorrectly I think
I mean.... In the complete text being generated... Diffrent delimiters should be used based on a condition.
So I can have dots, kommas and ";" in the complete text.
maybe something like:

Code: Select all

Func.EngineHelper.JoinCollumnContent.AddCondition(CollumnName,ValueToCheck, ColumnToPrint ,delimitor)
...
Unfortunately, but it is a very specific task.
In this case you can create your own fuction in code of report and use it.

Also this function already available in prerelease build from 2012.03.09
Thank you.
Post Reply