Hiding a groupheader if there's only one distinct record

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

Hiding a groupheader if there's only one distinct record

Post by PJoyeux »

Hi,

I need to be able to hide a group-header if the condition used for grouping returns just one record.

I have tried to use conditions and the enabled-property but had no success. The condition I used was

Code: Select all

Totals.CountDistinct ("Buchung.TerminNummer") > 1
But the Count always returns "1" even if I indeed have more than one group based on the datasource...

I have attached the report, I need to hide "GroupHeaderBand2" if there's only one different "Buchung.TerminNummer"

Thanks for your help!

Cheers,
Pascal
Attachments
Liste - Buchungen - Anschriften.mrt
(27.94 KiB) Downloaded 221 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Hiding a groupheader if there's only one distinct record

Post by HighAley »

Hello, Pascal.

Sorry, but we couldn't find CountDistinct() function in the attached report template.
Could you send us a sample project which reproduces the issue? The issue could be connected with used Business objects.

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

Re: Hiding a groupheader if there's only one distinct record

Post by PJoyeux »

Hi, Aleksey

Yes, you are right... I had changed this report so may times, that I ended up uploading the one WITHOUT condition... :roll: I have now attached the proper report.

But my question was more general: how to hide this band if there's only one different "Buchung.TerminNummer"? Is using a condition the right way?

Cheers,
Pascal
Attachments
Liste - Buchungen - Anschriften.mrt
(28.26 KiB) Downloaded 292 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Hiding a groupheader if there's only one distinct record

Post by HighAley »

Hello.

If there is only one row in the data source you could check if Buchung.Rows.Count > 1 and if this expression is false you could disable group header in the Conditions.

Thank you.
Post Reply