Join column related to other data

Stimulsoft Reports.NET discussion
Post Reply
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Join column related to other data

Post by StixStax »

Hey,

I'm trying to create a table where order dates are connected to a company name. I need to group those dates and have them in one line separated by ",".

Current Output:
Company name 1 ---- Order date 1
Company name 1 ---- Order date 2
Company name 1 ---- Order date 3
Company name 2 ---- Order date 1
...

Desired Output:
Company name 1 ----- Order date 1, order date 2, order date 3
Company name 2 ---- Order date 1
....

I created a sample file to show the current output.
I already tried "Func.EngineHelper.JoinColumnContent" for order dates but this will show all order dates for every company name on a databand.
Do you have any idea how to solve the issue?
Attachments
ConcatDate.mrt
(15.98 KiB) Downloaded 264 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Join column related to other data

Post by Alex K. »

Hello,

For the XML datasource, you can use the additional code in BeforePrint event of DataBand in which join necessary values.
For the sql datasource, you can use the JoinColumnContent() function and ReconnectOnEachRow option for the datasource.

Thank you.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Join column related to other data

Post by HighAley »

Hello.

Here is a sample report template.
We use a variable to store the data in Before Print event of the Data Band.
ConcatColumnInGroup.mrt
(16.72 KiB) Downloaded 489 times
Thank you.
StixStax
Posts: 46
Joined: Wed Aug 12, 2015 9:41 am

Re: Join column related to other data

Post by StixStax »

Thank you guys. Exactly what I needed. Excellent as always
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Join column related to other data

Post by Alex K. »

Hello,

We are always glad to help you!
Let us know if you need any additional help.

Thank you.
haleb
Posts: 16
Joined: Thu Sep 19, 2019 2:32 pm

Re: Join column related to other data

Post by haleb »

I am trying to do just this within the Dynamic Report Designer UI. Could you tell me how this would be done within the UI? We need to tie an asset id to a work order id and then have the data populate based off the work order id.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Join column related to other data

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data with a detailed description for analysis.

Thank you.
MarceloOD
Posts: 7
Joined: Thu Dec 08, 2022 11:48 pm

Re: Join column related to other data

Post by MarceloOD »

HighAley wrote: Fri Apr 22, 2016 11:51 am Hello.

Here is a sample report template.
We use a variable to store the data in Before Print event of the Data Band.
ConcatColumnInGroup.mrt
Thank you.
Hi, do you know why the variable is locked? I cannot see the code.
Capture.PNG
Capture.PNG (150.52 KiB) Viewed 1158 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Join column related to other data

Post by Lech Kulikowski »

Hello,

The issue was in one of old builds 2015.x and was fixed. But variables created in this build need change. You can manually edit mrt file in notepad or use the following code:

Code: Select all

foreach (StiVariable variable in report.Dictionary.Variables)
 {
variable.Inherited = false;
 }
Thank you.
Post Reply