Running Number in DataBand

Stimulsoft Reports.WPF discussion
Post Reply
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Running Number in DataBand

Post by PJoyeux »

Hi,

I need a running number in a DataBand. The report is grouped and I want to have the running number to start with 1 in each group like this:

Code: Select all

[Group 1]
  [1]  <- Field showing the current running number
  [2]
  [3]
[Group 2]
  [1]
  [2]
[Group 3]
  [1]
  [2]
  [3]
  [4]
...
I have tried to use "{CountRunning(GroupHeaderBand1)}" but the running number does not revert back to 1 when the group changes.

How can I best achieve this?

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

Re: Running Number in DataBand

Post by Alex K. »

Hello,

Please try to use the following code in AfterPrint event of GroupFooter component:

Code: Select all

TextComponent_Count.RunningTotal = false;
TextComponent_Count.Init();
Where the TexComponent is text component with countrunning expression.

Thank you.
User avatar
PJoyeux
Posts: 160
Joined: Tue Nov 26, 2013 9:40 am
Location: Germany

Re: Running Number in DataBand

Post by PJoyeux »

Thanks that worked!
I would never have known that I have to add "_Count" to the name of the component...

Where can I read more about coding events, how to access components and how to know what component-names to use?

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

Re: Running Number in DataBand

Post by Alex K. »

Hello,

Most probably, this solution is not described in the documentation. But we are constantly improving videos and documentation and other additional resources. It simply takes time.
You can find also more information about the product in our blog and forum.

Thank you.
Post Reply