Page 1 of 2

Show/Hide Field Label

Posted: Tue Jan 24, 2012 6:27 pm
by MikeC
I have a field label (Text54) that is next to a field with an expression in it (Text13). The expression is as follows {Substring(ContractOwners,0,(int)Length(ContractOwners)-2)} . The expression lists out contract owners, and ContractOwners is a variable where I'm capturing the names. Not all records have contract owners, so if the expression in Text13 doesn't have any data, or Text13 is empty I want to hide the label (Text 54).

I tried several things including conditions, but couldn't make Text54 appear when Text13 is populated or disappear when Text13 is empty. What do I need to do to turn Text 54 on or off depending on the contents of Text13.


Show/Hide Field Label

Posted: Wed Jan 25, 2012 5:15 am
by Alex K.
Hello,

Please send us your report with test data for analysis.

Thank you.

Show/Hide Field Label

Posted: Wed Jan 25, 2012 1:17 pm
by MikeC
I can't send you a copy of the report with the data, since it contains sensitive information.

It should be simple-I just need to show or hide a label based on the contents of it's associated data field. If the data field is empty I want the label to hide. If there is data in the data field I want the label to show. Can't Stimulsoft do something that simple?

Show/Hide Field Label

Posted: Thu Jan 26, 2012 7:26 am
by Alex K.
Hello,

You can use Conditions - if data empty then set the ComponentIsEnabled property to false.

Thank you.

Re: Show/Hide Field Label

Posted: Mon Oct 15, 2012 12:33 pm
by nicegaurav
can u plz let me know, how to show and hide labels dynamically, On C# code can we access the reports instances like property or methods through which we can achieve this...

this is urgent ..... thanx in advance

Re: Show/Hide Field Label

Posted: Tue Oct 16, 2012 12:09 pm
by Alex K.
Hello,

You can use the following code:

Code: Select all

Stimulsoft.Report.Components.StiText text1 = report.GetComponents()["Text1"] as StiText;
text1.Enabled = false;
Thank you.

Re: Show/Hide Field Label

Posted: Tue Oct 16, 2012 1:09 pm
by nicegaurav
Thanx for ur great help... it's working ,

But there is another issue, If we do enable false for a label, the space taken by the label remain same
can we fill the empty space by the adjacent control :?:

Thanks

Re: Show/Hide Field Label

Posted: Tue Oct 16, 2012 1:48 pm
by HighAley
Hello.

Please, send us your report template with data for analysis.

Thank you.

Re: Show/Hide Field Label

Posted: Tue Oct 16, 2012 6:53 pm
by nicegaurav
This is the scenario

First i have created a .mrt file(report), with some labels like

|-------------------------------|
| lbl1 lbl2 |
| lbl3 lbl4 |
| lbl5 lbl6 |
| lbl7 lbl8 |
| lbl9 lbl10 |
| lbl11 lbl12 |
|-------------------------------|

I put some value on the label at the time of report creations and now I want to do enable false lbl1 and lbl2 on c# code,
with the help of above code achieved this.Both the labels are not displaying when report creates in pdf format. But when the labels (lbl1 and lbl2) are disable, the first row sets blank and empty row displays. I want to shift second row at first place, third row at second, fourth row at third and so on....

Re: Show/Hide Field Label

Posted: Wed Oct 17, 2012 10:37 am
by Alex K.
Hello,

Please try to set the CanShrink property to true.

Thank you.