Page 1 of 2

Variable for dynamic concatenation

Posted: Wed Oct 06, 2010 7:11 am
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!

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 1:49 am
by Alex K.
Hello,

Please see the sample report in attachment.

Thank you.

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 2:37 am
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!

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 3:00 am
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.

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 4:48 am
by Jennypi
Thanks a lot, working perfectly :)

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 4:56 am
by Alex K.
Hello,

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

Thank you.

Variable for dynamic concatenation

Posted: Thu Oct 07, 2010 10:02 am
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

Variable for dynamic concatenation

Posted: Fri Oct 08, 2010 1:05 am
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.

Variable for dynamic concatenation

Posted: Tue Oct 12, 2010 9:45 am
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.

Variable for dynamic concatenation

Posted: Wed Oct 13, 2010 1:01 am
by Alex K.
Hello,

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

Thank you.