Panel.Visible

7 posts, 1 answers
  1. joshua odell
    joshua odell avatar
    30 posts
    Member since:
    Sep 2008

    Posted 30 Mar 2009 Link to this post

    I have a report that has a couple Panels in it, I'd like to be able to show or hide these panels based on a few parameters.  I didn't see a way to bind the "Visible" property to a report parameter, so I set it manually..  I've made the Panel variable public, and in my business logic I set the "Visible" property based on a few business rules.  However, whenever I set "Visible = false" on any panel, the whole report fails to load.  I get "No Page to Display"

    is there something special about the "Visible" property on the panel?  or is there a better way to show/hide a portion of a report?  I considered using sub reports, but thought that this would be much easier then creating a bunch of sub reports.

    Thanks
  2. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 02 Apr 2009 Link to this post

    Hello joshua odell,

    The Visible property is included in the Style. It can be located in the Style section of the item's property grid. This way you would be able to use conditional formatting.
    Note that  the business logic that relies on report parameters cannot be placed in the report constructor.

    Sincerely yours,
    Hrisi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. joshua odell
    joshua odell avatar
    30 posts
    Member since:
    Sep 2008

    Posted 02 Apr 2009 Link to this post

    I am able to set the visibility style property on an imagebox, and a textbox, but as asoon as I use the same mechanism to set the visible style on a panel, the whole report does not display.  I would almost be ok with setting this style on all my objects, but the panels would still show, which would mean I'd have a page of essentially blank panels, which isn't acceptable

    I've done the following
    Created 2 report parameters "UsePressure" and "UseVacuum" I have 2 panels on my report "PressurePanel" and "VacuumPanel"  I have 1 rule for each panel  the rule says

    EXPRESSION          = false
    Operator                 =
    Value                    = Parameters.UseVacuum
    and 
    EXPRESSION          = false
    Operator                 =
    Value                    = Parameters.UsePressure

    on each rule I've set the "Style" to have the visibility unchecked.

    in my app class I create an instance of the report object, and then set all the report parameters on it, as so

     

    param["UsePressure"].Value = Model.Options.UsePressureSide;

     

    param["UseVacuum"].Value = Model.Options.UseVacuumSide;

    Model is just a POCO object that is my business entity.

     

     

  5. joshua odell
    joshua odell avatar
    30 posts
    Member since:
    Sep 2008

    Posted 03 Apr 2009 Link to this post

    I've done a little more digging and have found the following.
    If I place an HTMLTextBox inside of a panel and set the visible property on the panel to false, then the whole report fails to render.  if I use a regular textbox inside of the panel, it works fine.  this happens if I put plain text in the html textbox, or bind it ti a reportparameter.
    this seems to be isolated to the htmlTextbox.  Has anyone else experienced this. or is there perhaps something else that I'm doing wrong with the report?

    I've also tried doing this with a subreport instead of a panel.  I set the SubReport.Visible property to false, and if there is an HTMLTextbox inside of the sub report then the whole parent report does not render.

    Josh
  6. Answer
    Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 06 Apr 2009 Link to this post

    Hi joshua,

    We have confirmed that the behavior observed for the new HtmlTextBox item is a bug in our image rendering module. For the time being there is no workaround available. The issue is already addressed and will be included in the upcoming service pack. 1000 Telerik points have been added to your account for the input.

    Regards,
    Hrisi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  7. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2013 Link to this post

    Hi there, 

    I have my report which consists of a panel inside a list and a set of text boxes, as you can see
    in ide_report.jpg (attached), the list has a RowGroup and a ColumnGroup as you can see in order
    to spread the items across the pages as shown in output_report.jpg (also attached).

    The problem is this, my data only consists of 32 elements (id=1,2, ..., 32) and as you can see
    in output_report.jpg, the last element is empty (there's not such element with id=33), 

    the question I have is, how do I hide all the elements for that item object that's beyond
    the data (the last one)?

    I created a conditional formatting at the Panel level saying Fields.Id is equal to null 
    as shown in condform_report.jpg and still I keep seeing the last block with no data on it.

    I would like to hide those remaining blocks that has no data on it. How do I do that?
  8. Wadigzon
    Wadigzon avatar
    58 posts
    Member since:
    Feb 2013

    Posted 25 Feb 2013 Link to this post

    I figured it out, this is the solution:

    go to the property of panel object,
    on Bindings add New, 

    Property Path is "Style.Visible"

    Expression is "= IsNull(Fields.Id, -1) > 0"

    cheers!
Back to Top
DevCraft banner