This is a migrated thread and some comments may be shown as answers.

Hide Textbox in Report based on Report Parameter

1 Answer 1026 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Windhoek2010
Top achievements
Rank 1
Windhoek2010 asked on 08 Jan 2020, 04:10 PM

I have an HtmlTextBox named htmlTextBox5 within my report, which I want to HIDE dynamically based on one of the parameters passed into the report when it is generated, Parameter2.

Basically:

if (Parameter2.value == "2")
{
     htmlTextBox5.Visible = false;
}

 

Question is how do I get Parameter2 from within the report constructor? Or should I be setting the Visible property of htmlTextBox5 somewhere else?

 

 

1 Answer, 1 is accepted

Sort by
0
Katia
Telerik team
answered on 13 Jan 2020, 09:41 AM

Hi,

The most straightforward approach would be to bind the Visible property of the HtmlTextBox item to the value of the report parameter using the report designer. Here is an example of expression that can be set in expression part of the binding:

= Parameters.Parameter2.Value = "2"

More detailed information can be found in the following help articles:

Bindings

Expressions Reference

Using Report Parameters in Expressions

 

Regards,
Katia
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Windhoek2010
Top achievements
Rank 1
Answers by
Katia
Telerik team
Share this question
or