Condition for Text-Component in GroupHeaderBand

Stimulsoft Ultimate discussion
Post Reply
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Condition for Text-Component in GroupHeaderBand

Post by tpontow »

Hello Stimulsoft,

is it possible to define a condition for a StiText-Component which is placed in a GroupHeaderBand so that the text component is only enabled / shown if the group is expanded?

Thanks and regards
Thorsten Pontow
Attachments
Group Header is expanded and it is ok to see the text.
Group Header is expanded and it is ok to see the text.
GroupHeaderExpanded.png (11.8 KiB) Viewed 2568 times
Group Header is collapsed and the text should now be hidden.
Group Header is collapsed and the text should now be hidden.
GroupHeaderCollapsed.png (10.85 KiB) Viewed 2568 times
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. »

Hello,

In this case, you can place Text components from GroupHeader on the DataBand and by Condition show it only for the first line.

Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Condition for Text-Component in GroupHeaderBand

Post by tpontow »

Is it then shown (with expanded Group) on following pages after page break as it is when i place it in Group header? Should Condition be (GroupLine == 1 => textComponent is enabled)?
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. »

Hello,

Please send us a sample report which reproduces the issue for analysis.

Thank you.
User avatar
tpontow
Posts: 206
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Condition for Text-Component in GroupHeaderBand

Post by tpontow »

Hi Alex,

thanks for your response. Meanwhile i found a solution that works for me. I used the GetTag-Event for components in compiled Report.

Code: Select all

dataBandComponent.GetTag += ChangeComponentAppearanceByCellInformation;
In the Event handler i use:

Code: Select all

if (textComponent.Parent is StiGroupHeaderBand groupHeaderBand)
{
        bool collapsed = StiDataBandV2Builder.IsCollapsed(groupHeaderBand, false);
        if (textComponent.Name.StartsWith("GroupHeaderText"))
         {
              textComponent.Enabled = !collapsed;
         }
Kind regards
Thorsten Pontow
Thorsten Pontow

It is easier to write an incorrect program than to understand a correct one. (Alan J. Perlis, Epigrams in programming No. 7)
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. »

Hello,

Thank you for the provided solution.
Post Reply