Variable for dynamic concatenation

Stimulsoft Reports.WEB discussion
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Variable for dynamic concatenation

Post by Jennypi »

Hi everyone,
I have a table like this:

Code: Select all

name   location
B   1
A   2
B   3
A   4
A   1
C   4
B   5
B   2
C   3
I would like to display one row for each name + a string containing all the locations

Code: Select all

name   locations
A   1-2-4
B   1-2-3-5
C   3-4
How can I do that?

Thanks!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable for dynamic concatenation

Post by Alex K. »

Hello,

Please see the sample report in attachment.

Thank you.
Attachments
643.SampleReport.zip
(1.82 KiB) Downloaded 653 times
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Variable for dynamic concatenation

Post by Jennypi »

Hi

Thanks for the sample report but I don't understand where the concatenation is defined. Where do you specify that the variable is linked to F2 and that it has to join all the F2 values?

Thanks again!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable for dynamic concatenation

Post by Alex K. »

Hello,

In "Before Print" event on GroupHeaderBand

Code: Select all

Variable = "";
And in "After Print" event on DataBand component

Code: Select all

Variable += DS.F2 + "-";
Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Variable for dynamic concatenation

Post by Jennypi »

Thanks a lot, working perfectly :)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable for dynamic concatenation

Post by Alex K. »

Hello,

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

Thank you.
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Variable for dynamic concatenation

Post by Jennypi »

I do actually!
I've just realized that my csv export is not working anymore with the footer band. Nothing is exported. Is there any solution for that?

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

Variable for dynamic concatenation

Post by Alex K. »

Hello,

In Csv, Dbf and Xml only textboxes from DataBand are exported ("only data").
In this case you can use DataBand componentn on Footer component.
Please see the sample report in attachment.

Thank you.
Attachments
644.SampleReport.mrt
(21.65 KiB) Downloaded 442 times
Jennypi
Posts: 361
Joined: Mon Nov 17, 2008 7:13 am
Location: France

Variable for dynamic concatenation

Post by Jennypi »

If I understand well, based on your example, I should change my report from (group header / databand / group footer) to (header / databand / footer+databand)?
How do you stick together the DataBand component and the Footer component? Because when I try to add both, there is space in between, not like in your example.
Where should I put the calculation of my variable? In the "Before Print" event of the headerBand?

Sorry, I am quite a rookie at Stimulsoft Reports...

Many thanks.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Variable for dynamic concatenation

Post by Alex K. »

Hello,

You can add the Panel component on GroupFooter and then put DataBand on Panel.

Thank you.
Post Reply