Page 1 of 1

Hide some record without filter

Posted: Wed Mar 26, 2008 1:59 pm
by achmadmulyadi
I have grouped data:

Product ID P0001

Trans Date Qty
-----------------------------
1/13/2008 10
1/20/2008 5
2/3/2008 7
2/5/2008 1
--------------------------
Total Qty 23

But I want to show the records with Trans Date after 1/2/2008 only and show all the previous record in summary. So, this is the report I want to create:
Product ID P0001
Previous Qty: 15

Trans Date Qty
-----------------------------
2/3/2008 7
2/5/2008 1
--------------------------
Total Qty 23

I can calculate the previous Qty using SumIf, but I can not hide the January record. Do you know how to achieve that? Thanks.

Hide some record without filter

Posted: Thu Mar 27, 2008 2:47 am
by Edward
Please do as follows:

1. Set the DataBand.CanShrink property in true.

2. In the BeforePrintEvent of the DataBand please write the following code:

if (MyDataSource.TransDate < DateTime.Parse("1/2/2008"))
{
MyTextComponent.Height = 0;
...
MyTextComponentN.Height = 0;
}
else
{
MyTextComponent1.Height = 0.3;
...
MyTextComponentN.Height = 0.3;
}

You may open the attached report in the Demo.exe application from the standard delivery and see all of that in action.

Thank you.