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

How to dynamically show/hide pictureBox?

5 Answers 796 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 15 Dec 2008, 02:30 PM
Hi Support,

I've tried several ways to dynamically show/hide the picturebox in Telerik Reporting. It seems no luck.

1. In report constructor:
public partial class Report1 : Telerik.Reporting.Report
    {
        public Report1 ()
        {
            /// <summary>
            /// Required for telerik Reporting designer support
            /// </summary>
            InitializeComponent();

            this.pictureBox1.Visible = Convert.ToBoolean(this.Report.ReportParameters["isPic"].Value);
        }
    }

2. Conditional formatting Rules
=Parameters["isPic"]==true
In the preview section, I click on button "Style" to open up the Style Builder dialog. Under Layout section, I check the "Visible" check box.

However, both ways seems not working...

Any advice?

Thanks,
Sandy

5 Answers, 1 is accepted

Sort by
0
Sandy
Top achievements
Rank 1
answered on 17 Dec 2008, 03:30 PM
My work around for this is,

- Select the picturebox, in the Value property enters,

=IIF(Parameters.IsDraft, "mypicture.png", "transparency.png")

However, I think it's not a practical way to achieve this.

Why Telerik Reporting does not have the expression option under Visible column property like it's in Microsoft Reporting (.rdl file)?

Thanks,
Sandy


0
Accepted
Steve
Telerik team
answered on 17 Dec 2008, 04:14 PM
Hello Sandy,

The conditional formatting is working as expected. There are just two more things that you need to do:
  • change the rule to =Parameters.isPic==true (no brackets)
  • add a second rule that specifies what should be done in the other case =Parameters.isPic==false and set Visible=false under Layout for this rule.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mehmet
Top achievements
Rank 1
answered on 28 Nov 2016, 01:53 PM

merhaba 

ana dilimde yazıyorum umarım cevap verirsiniz.

raporda sorgudan alınan değişken değerine göre bir nesnenin görünürlüğünü ayarlayabiliyor muyuz?

0
Stef
Telerik team
answered on 28 Nov 2016, 02:03 PM
Hi Mehmet,

The official language used for our correspondence is English. We will appreciate it if we continue this discussion in English.

Based on Google Translate, the question is if you can control the items' visibility based on fields (data). The answer is yes, by applying conditional formatting or binding the corresponding item's Visible property.


I hope this helps.

Regards,
Stef
Telerik by Progress
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
0
Marco
Top achievements
Rank 1
answered on 23 Jun 2020, 08:55 PM
Maybe I can help you.

I made a dll and into the change from images svg to png. but is  lot hard the configuration, the most simple is make a parameter string and send the value from the page, for example:

reportViewer1.ReportSource.Parameters.Add("pBmp", svgStr)

the image must be pass how base64String, for example:

Dim base64String As String = Convert.ToBase64String(Stream.GetBuffer())

Greetings,
Marco
Tags
General Discussions
Asked by
Sandy
Top achievements
Rank 1
Answers by
Sandy
Top achievements
Rank 1
Steve
Telerik team
Mehmet
Top achievements
Rank 1
Stef
Telerik team
Marco
Top achievements
Rank 1
Share this question
or