Hidden row after calculating

Stimulsoft Reports.NET discussion
Post Reply
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Hidden row after calculating

Post by ymc »

Hi,
I have a problem about can I hidden a row after calculating inside the report?
for example:
I have a column a have 5 datas as 100,200,300,400,500.
and I want to display the cumulative value >350.
That means the first 100,200 don't display and display 300,400,500.
But those calculation was completed during rendering.
So the result as

300
400
500

How can I do this?
Can I set it at the renderingEvent say
if (abc += a < 350) Databand.CountData = 0;

Thx.
EDV Gradl
Posts: 228
Joined: Sat Jun 17, 2006 9:50 am
Location: Germany

Hidden row after calculating

Post by EDV Gradl »

You need a running variable mysum

On the OnRenderingEvent of the databand you do:

mysum += myfield;

On the BeforePrintEvent on the databand you do

databand.Enabeld = mysum > 350

Marco
ymc
Posts: 31
Joined: Tue Oct 30, 2007 9:00 pm
Location: Hong Kong

Hidden row after calculating

Post by ymc »

Oh, Thx.
I have tried your method but found it's not work.
I found that databand.Enabeld = mysum > 350 does not display anything.
But during I changed to databand.Enabeld = mysum < 350 it display the first 3 row as the data 100,200,300.
I would like to check each row of data of mysum to see which row is grater than 350 then show it out.

And one more thing I found that 300 should not be show if mysum <350.
I think the vaule of mysum did not change during beforeprintevent. Thus the result also wrong.
Thx.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Hidden row after calculating

Post by Edward »

Please move the code from OnRenderingEvent in the Marco's solution into BeforePrintEvent:

BeforePrintEvent:

mysum += myfield;
databand.Enabeld = mysum > 350;

Thank you.

Post Reply