Page 1 of 1

Conditionally hiding content

Posted: Wed Jan 20, 2010 3:21 pm
by aferguson
Is there an easy way to c and alonditionally hide an object (e.g. a Panel and all of its children) based on some condition? The page rendering events seem like a natural place to do it, as the "Conditions" area seems only to be able to affect the "enabled" property. Are "Printable" and visibility equivalent? If so, in one of the page rendering events might you do something like:

Code: Select all

panelName.Printable = false; 
?

Thanks.

Conditionally hiding content

Posted: Thu Jan 21, 2010 2:33 am
by Edward
Hi

Please use Enabled property in the BeforePrintEvent for hiding elements completely (in viewer and when printing).

'Printable' property allows to disable printing components on paper. Components will be shown in viewer, even if Printable == false.

Thank you.

Can we hide the barcode (code 39) conditionally

Posted: Sat May 20, 2017 11:22 am
by satishb
Hello,
While printing the barcode code39 I need to hide barcode if the scannable value is null or empty. Can we do this using stimulsoft designer tool ?
If yes then please provide the solution.

Re: Conditionally hiding content

Posted: Sun May 21, 2017 8:21 pm
by Kubekin Yuriy
Hello, satishb.

You must use "Highlight Condition" and set "Component is Enabled" to false.
https://www.youtube.com/watch?v=rb5Um9tlpWU

Thank you.

Re: Conditionally hiding content

Posted: Thu May 25, 2017 6:28 am
by satishb
Thanks Kubekin Yuriy.
I had looked into your solution but, I need to hide the barcode(UI of barcode) conditionally on report if the value against that barcode is null or empty using stimulsoft designer tool.
I still facing the same problem. Please provide the solution for that if any.
Thanks

Re: Conditionally hiding content

Posted: Thu May 25, 2017 9:26 am
by Alex K.
Hello,

Please send us your report with test data which shows the issue for analysis.

Thank you.

Re: Conditionally hiding content

Posted: Wed May 31, 2017 2:49 pm
by satishb
Hi,Please find the attachment which contains the actual image files of stimulsoft report designer and printed report.

Thanks

Re: Conditionally hiding content

Posted: Wed May 31, 2017 2:51 pm
by satishb
Hello Aleksey,
I just provide the image files of actual issue. Please have look into that and provide the solution for that if any.

Thanks

Re: Conditionally hiding content

Posted: Wed May 31, 2017 11:35 pm
by Edward
Hi satishb,

You also can hide the BarCode component from the code before rendering the report. In the screenshots below I modified the Work With Report Components sample project:
https://www.stimulsoft.com/en/samples/w ... components
This can be done with barcodes or any other component
This is the line of code I added to hide/show the BarCode1 component in the page:

Code: Select all

((StiBarCode)stiReport1.Pages["Page1"].Components["BarCode1"]).Enabled = string.IsNullOrEmpty(textBox1.Text);
Add BarCode1 Component in the Designer and Save the Report
Add BarCode1 Component in the Designer and Save the Report
BarCode1.PNG (94.02 KiB) Viewed 12208 times
Click Preview and the BarCode1 won't print, because there is a text in the textbox
Click Preview and the BarCode1 won't print, because there is a text in the textbox
BarCode2.PNG (40.83 KiB) Viewed 12208 times
Remove Text, click Preview and BarCode1 will be printed
Remove Text, click Preview and BarCode1 will be printed
BarCode3.PNG (49.08 KiB) Viewed 12208 times
Work with Components.mrt
The modified report file from Samples-WPF-CSharp-master\Work with Report Components\ folder
(4.08 KiB) Downloaded 660 times
Thank you,
Edward