Condition for Text-Component in GroupHeaderBand

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

Condition for Text-Component in GroupHeaderBand

Post by tpontow » Fri Mar 09, 2018 8:18 am

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
GroupHeaderExpanded.png
Group Header is expanded and it is ok to see the text.
GroupHeaderExpanded.png (11.8 KiB) Viewed 546 times
GroupHeaderCollapsed.png
Group Header is collapsed and the text should now be hidden.
GroupHeaderCollapsed.png (10.85 KiB) Viewed 546 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: 6486
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. » Mon Mar 12, 2018 9:38 pm

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: 205
Joined: Thu Sep 06, 2012 8:46 am
Location: Bonn, Germany

Re: Condition for Text-Component in GroupHeaderBand

Post by tpontow » Tue Mar 13, 2018 7:35 am

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: 6486
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. » Thu Mar 15, 2018 6:56 am

Hello,

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

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

Re: Condition for Text-Component in GroupHeaderBand

Post by tpontow » Thu Mar 15, 2018 7:43 am

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: 6486
Joined: Thu Jul 29, 2010 2:37 am

Re: Condition for Text-Component in GroupHeaderBand

Post by Alex K. » Fri Mar 16, 2018 8:18 am

Hello,

Thank you for the provided solution.
Post Reply