Add a variable of type int to the report, start value is 0, lets say it is called MySum
Edit the RenderingEvent of the databand and add
MySum++;
Now you can print this sum in the databand:
{this.MySum}
I hope that helps.
Marco
Add a variable of type int to the report, start value is 0, lets say it is called MySum
Edit the RenderingEvent of the databand and add
MySum++;
Now you can print this sum in the databand:
{this.MySum}
I hope that helps.
Marco
Thanks. It helps.
What about in GroupheaderBand?? Is it the same?
I have test it in groupheaderband, but instead of appearing 1,2,3... it appears as 1,2,5,13 & so on.
Thanks.
Correct berhaivor. The variable increments by on for every data row.
For use in Group Headerband, you need a second variable MySumGroup and you should you the rendering event of the group for the new variable.
Thanks, Marco
EDV wrote:
Correct berhaivor. The variable increments by on for every data row.
For use in Group Headerband, you need a second variable MySumGroup and you should you the rendering event of the group for the new variable.
Thanks, Marco
Thanks for your help.
But, i seems not able to get the desired results.
I have try as below
Add a variable of type int to the report, start value is 1, & named it as MyGroupSum
Edit the RenderingEvent of the GroupHeaderBand and add
MyGroupSum++;
In the GroupHeaderBand:
{this.MyGroupSum}
But, the result is still the same... 1, 3, 4, 5....
Can you help on this? Thanks
Hmm, it seem that the event is called every timer, even if the Band is not printed.
I would try BeforePrint of the groupband or
BeforePrint of the text component inside the group band.
Let me know if it works..
Marco
EDV wrote:
Hmm, it seem that the event is called every timer, even if the Band is not printed.
I would try BeforePrint of the groupband or
BeforePrint of the text component inside the group band.
Let me know if it works..
Marco
Thank you so much!!!
It is working now.!! Finally!!!
:biggrin:
I have to to create the running sum again in the databand. But I failed using the same method as below in the post.
I do not know what wrong's with it.
It keeps giving errors as below
Exception Details: System.Exception: C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\d-gnyqzn.0.vb(57,0) : warning BC40004: variable 'Unit' conflicts with property 'Unit' in the base class 'StiReport' and should be declared 'Shadows'.C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\d-gnyqzn.0.vb(201,0) : error BC30454: Expression is not a method.C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\d-gnyqzn.0.vb(201,0) : error BC30800: Method arguments must be enclosed in parentheses.C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\d-gnyqzn.0.vb(201,0) : error BC30037: Character is not valid.
Please help me on that.
Is your variable called 'unit'?
Try changing that name, cause unit is already a member in the StiReport Class.
Marco
EDV wrote:Is your variable called 'unit'?
Try changing that name, cause unit is already a member in the StiReport Class.
Marco
C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\fs3mds9m.0.vb(197,0) : error BC30454: Expression is not a method.
C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\fs3mds9m.0.vb(197,0) : error BC30800: Method arguments must be enclosed in parentheses.
C:\Documents and Settings\Chan Kuan Leang\Local Settings\Temp\fs3mds9m.0.vb(197,0) : error BC30037: Character is not valid.
Hmm.. I have rename my textbox. But, it comes up with the above errors.
Please help on that.
I created a variable "MySum" int, Default Value = 0
Then in the databand, I have tried putting MySum++; in Before Render or Rendering Events & Before Print, it still comes up with the same errors.