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

Panel.Visible

6 Answers 901 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
joshua odell
Top achievements
Rank 1
joshua odell asked on 30 Mar 2009, 10:54 PM
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

6 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 02 Apr 2009, 08:11 AM
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.
0
joshua odell
Top achievements
Rank 1
answered on 02 Apr 2009, 05:47 PM
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.

 

 

0
joshua odell
Top achievements
Rank 1
answered on 03 Apr 2009, 08:39 PM
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
0
Accepted
Hrisi
Telerik team
answered on 06 Apr 2009, 01:19 PM
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.
0
Wadigzon
Top achievements
Rank 1
answered on 25 Feb 2013, 08:39 PM
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?
0
Wadigzon
Top achievements
Rank 1
answered on 25 Feb 2013, 09:22 PM
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!
Tags
General Discussions
Asked by
joshua odell
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
joshua odell
Top achievements
Rank 1
Wadigzon
Top achievements
Rank 1
Share this question
or