Page 1 of 1

Hide Group Header Issue

Posted: Thu May 29, 2008 9:08 am
by mace242
I want to hide a group header if there are no entries in the group. How do I do this?

I have tried adding a condition that disables the group header band along the lines of the expression: Count(DataBand1,Customers.Region) <= 1 setting the enabled to false.

Ho do I do this? I need to hide a header band depending on the count of items in that group. I may also need to hide the header and details bands if the count is, say, less than 10. How would I do this?

I need to do this without using the events if at all possible. I can't understand why I can put a text with {Count(DataBand1,Customers.Region)} in the group header but I cannot find out what {Count(DataBand1,Customers.Region)} is when using conditions on that header.

Thanks in advance.

Tim.

Hide Group Header Issue

Posted: Thu May 29, 2008 6:13 pm
by Vital
Hello Tim,
I want to hide a group header if there are no entries in the group. How do I do this?

I have tried adding a condition that disables the group header band along the lines of the expression: Count(DataBand1,Customers.Region) <= 1 setting the enabled to false.

Ho do I do this? I need to hide a header band depending on the count of items in that group. I may also need to hide the header and details bands if the count is, say, less than 10. How would I do this?
Sorry, you can't disable GroupHeaderband because in this case you disable whole group. But you disable components which placed on GroupHeaderBand. Set property CanShrink of band to true. Place all components to one container. After then add condition to this container.
I need to do this without using the events if at all possible. I can't understand why I can put a text with {Count(DataBand1,Customers.Region)} in the group header but I cannot find out what {Count(DataBand1,Customers.Region)} is when using conditions on that header.
Please use Totals.Count instead Count in conditions.

Thank you.

Hide Group Header Issue

Posted: Fri May 30, 2008 2:40 am
by mace242
Totals.Count returns the total count of all rows in the report (unless I'm missing something - where would I find the documentation for it?). I need the count of the group. For example:

H: Header One
D: Details One (Header One)
D: Details Two (Header One)
H: Header Two
H: Header Three
D: Details One (Header Three)
D: Details Two (Header Three)

Where H: is a header band grouping by Header One, etc and D: is a details band.

I want to not show the line "H: Header Two" as it has no associated detail records.

I cannot use Totals.Count as in all cases here the value for that would be 4 (the number of details records). If I add a Text Field in the format {Count(DataBand,Field)} into the header the following would be the result:

H: Header One 2
D: Details One (Header One)
D: Details Two (Header One)
H: Header Two 0
H: Header Three 2
D: Details One (Header Three)
D: Details Two (Header Three)

What I want to do is access the total in the conditions so that I can disable the line that reads "H: Header Two 0" leaving the report as:

H: Header One 2
D: Details One (Header One)
D: Details Two (Header One)
H: Header Three 2
D: Details One (Header Three)
D: Details Two (Header Three)

How would I do this?

Thanks.

Hide Group Header Issue

Posted: Fri May 30, 2008 3:45 am
by mace242
Figured it out. For the record what you do it this:

The condition expression should be the following: Totals.Count(GroupHeaderBand) == 0 and then the enabled tick turned off.

Totals.Count works in a flexible kind of way as far as I can see. For example:


Totals.Count(GroupHeaderBand) will return the count of items within that group.

Totals.Count(DataDetailsBand) will return the number of details bands in the report - funny enough regardless of if they are disabled.


Could not find the documentation for it and this would be really handy.

Thanks

Tim.

Hide Group Header Issue

Posted: Wed Oct 28, 2009 2:13 am
by Pio Leonardo V. Rapirap
mace242 wrote:Figured it out. For the record what you do it this:

The condition expression should be the following: Totals.Count(GroupHeaderBand) == 0 and then the enabled tick turned off.

Totals.Count works in a flexible kind of way as far as I can see. For example:


Totals.Count(GroupHeaderBand) will return the count of items within that group.

Totals.Count(DataDetailsBand) will return the number of details bands in the report - funny enough regardless of if they are disabled.


Could not find the documentation for it and this would be really handy.

Thanks

Tim.

Hi I also have the same problem where I want to disable Group Header with no details under it.

Can you please clarify which Condition Expression were you referring to?
Was it the Group Condition Expression? or shall I put conditions somewhere Print and Render Events?

Badly Need Help.

Hide Group Header Issue

Posted: Wed Oct 28, 2009 6:03 am
by Edward
Hi,

In that case you can add the following code in the BeforePrint of the GroupHeaderBand1:

Code: Select all

Text1.Enabled = Totals.Count(GroupHeaderBand1)>0;
GroupHeaderBand1.Height = Totals.Count(GroupHeaderBand1)==0?0:1.2; 

Here 1.2 - is the regular height of GropuHeaderBand1 and Text1 - is the text box inside of the Group Header.

Thank you.