How to dynamically show/hide pictureBox?

6 posts, 1 answers
  1. Sandy
    Sandy avatar
    14 posts
    Member since:
    Jul 2008

    Posted 15 Dec 2008 Link to this post

    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
  2. Sandy
    Sandy avatar
    14 posts
    Member since:
    Jul 2008

    Posted 17 Dec 2008 Link to this post

    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


  3. Answer
    Steve
    Admin
    Steve avatar
    10940 posts

    Posted 17 Dec 2008 Link to this post

    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.
  4. Mehmet
    Mehmet avatar
    2 posts
    Member since:
    Nov 2016

    Posted 28 Nov 2016 Link to this post

    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?

  5. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 28 Nov 2016 Link to this post

    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
  6. Marco
    Marco avatar
    1 posts
    Member since:
    Jun 2020

    Posted 23 Jun 2020 in reply to Sandy Link to this post

    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
Back to Top