Page 1 of 1

Repeated databand according to a value

Posted: Thu Dec 02, 2010 9:29 am
by Jennypi
Hi,

My report displays a list, let's say of orders.
I would like to display 3 rows (instead of 1) for an order if the field client = "AAAA".
How can I do that ?

Many thanks.

Repeated databand according to a value

Posted: Fri Dec 03, 2010 12:41 am
by Alex K.
Hello,

You can add the variable and After Print event of DataBand use the following code:

Code: Select all

if (VariableCountRepeat < 2 && DataSource.Field == "AAAA")
{
	DataSource.Prior();
	VariableCountRepeat ++;
}
Please see the sample report in attachment.

Thank you.

Repeated databand according to a value

Posted: Fri Dec 03, 2010 2:45 am
by Jennypi
Thanks for your reply.

I tried something like this (either in before or after print event):

Code: Select all

if (DataSource.Field=="AAAA")
{DataBand1.CountData=3]
But it's not working, concerned rows are only listed once.
Am I missing something?

Thank you.

Repeated databand according to a value

Posted: Fri Dec 03, 2010 4:11 am
by Alex K.
Hello,

Your way is not correct, since the CountData property is used if there is no binding of the data band to a data source.

Thank you.

Repeated databand according to a value

Posted: Fri Dec 03, 2010 6:17 am
by Jennypi
Ok I understand.
So I created another databand (DataBand2) linked to my datasource.
DataBand1 has now Databand2 as a master component.

I put my code in the Before or AfterPrint event of the master DataBand, but again, it is not working.


Thank you for your help!

Repeated databand according to a value

Posted: Fri Dec 03, 2010 6:31 am
by Jennypi
I forgot to set the Count Data property of DataBand1 to 1.
It seems to be working ok now.

Thank you very much.

Repeated databand according to a value

Posted: Fri Dec 03, 2010 6:34 am
by Alex K.
Hello,

Please look an example, I sent you in my first post, once again. Everything works as you need.

Thank you.