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

Surpress Text Box

2 Answers 254 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
NY Norton
Top achievements
Rank 1
NY Norton asked on 09 Sep 2008, 12:52 PM
If a certain data field is blank, I want to surpress the caption text box and the data field text box to reclaim that space on the report.  Right now, I am using conditional formatting to hide the text boxes but blank spaces remain.

Is thare any way to surpress those items so the data element under them will move up and use that space?

2 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 09 Sep 2008, 02:39 PM
Hi jalmto,

Are you using the Web ReportViewer for showing the report? If this is the case items with Visible=false are not rendered at all and as the HTML rendering extension is not a page oriented format, it would take up the space up automatically. This however goes only for vertical whitespace - horizontal whitespace would not be taken up automatically and this is by design.
A possible approach is making all TextBoxes very short, i.e. decrease their height to almost zero, keep the original spacing between them, and set their CanGrow property to true. In this way when a TextBox has some data to show it will grow as much as needed pushing all below it dows, and if it does not have any data -- it will be invisible and it would not occupy a lot of space because its height is minimal.
Second approach is
to change the Textboxes' Size.Height and change their Location.Y properties appropriately, after you hide the unwanted items.
Another solution is to add the textboxes dynamically at runtime on the right location and with appropriate size, based on the user input, instead of creating all the columns at design time and then hide them.

If you have a report with Height reportHeight, and you have to display rowCount rows, then each row should look like reportHeight / rowCount  wide, and the Location.Y of the textboxes should be

( reportHeight / rowCount ) * 0
(
reportHeight / rowCount ) * 1
(
reportHeight / rowCount ) * 2
...
(
reportHeight / rowCount ) * (rowCount - 1)

Please, have in mind to make the items a little bit narrower, so that they do not overlap.


Give these approaches a try and see whether you can achieve the results that you desire. If you exprience any problems or difficultities, please send us your original report and we will advise what more can be done.

Greetings,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
NY Norton
Top achievements
Rank 1
answered on 10 Sep 2008, 12:28 PM
Thank you for the tips!

I used the one whereas I make the text box height really small.  This works well since this only applies to a few items on the report.  It was easy and worked well!

Thank you!
Tags
General Discussions
Asked by
NY Norton
Top achievements
Rank 1
Answers by
Steve
Telerik team
NY Norton
Top achievements
Rank 1
Share this question
or