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

Collapse empty sections (height)

5 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joshua Kent
Top achievements
Rank 2
Joshua Kent asked on 09 Nov 2010, 12:50 AM
I have an issue where I have a series of lists or panels that might or might not contain data. If they don't contain data I want them to shrink down to their minimum height.

is this possible?

I attached screenshots I hope help illustrate what I am trying to accomplish.


**Update - Continuing to look at the documentation, it looks like perhaps docking or anchoring would accomplish this... but I am not positive how to go about it. I will continue playing... I welcome any assistance though.

5 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 11 Nov 2010, 03:51 PM
Hello Joshua,

You can set the height of each container item (report section or panel item) to a really small number in the report constructor right after the InitializeComponent() method.

All the best,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Joshua Kent
Top achievements
Rank 2
answered on 11 Nov 2010, 07:15 PM
no change, I tried setting it to a pixel of 1 and also inch of 0 but both had no effect.

public FacultyForm()
{
    //
    // Required for telerik Reporting designer support
    //
    InitializeComponent();
 
    //
    // TODO: Add any constructor code after InitializeComponent call
    //
    pnlRelationships.Height = Unit.Inch(0);
    pnlRelationshipInstance.Height = Unit.Inch(0);
    detail.Height = Unit.Inch(0);
    pnlQuestionAnswers.Height = Unit.Inch(0);
    listQuestionAnswer.Height = Unit.Inch(0);
    listRelationship.Height = Unit.Inch(0);
    listRelationshipInstance.Height = Unit.Inch(0);
}
0
Steve
Telerik team
answered on 12 Nov 2010, 02:20 PM
Hello Joshua,

Not sure how you've managed to instantiate the Unit class without new keyword. Additionally height of 1 pixel cannot be produced in browsers so they ignore it, height of 0 is invalid. Try the following instead:

pnlRelationships.Height = new Telerik.Reporting.Drawing.Unit(0.01, Telerik.Reporting.Drawing.UnitType.Inch);
....

All the best,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Joshua Kent
Top achievements
Rank 2
answered on 15 Nov 2010, 10:31 PM
Still no luck, I am sorry for the back and forth. I change the code as following. I am also trying to fix an issue where I have pages that are 90% blank so I also set the keeptogether attribute to false (in the design view and then in code behind after that didn't work).

I attached two screen shots of what is happening. I don't want to upload the entire pdf output because of confidential information in it. If you would prefer I can open up a support ticket with all of these files in it.

Thanks again for all of your assistance,
   Josh

pnlRelationships.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
pnlRelationshipInstance.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
pnlQuestionAnswers.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
listQuestionAnswer.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
listRelationship.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
listRelationshipInstance.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
 
detail.Height = new Telerik.Reporting.Drawing.Unit(.01D, Telerik.Reporting.Drawing.UnitType.Inch);
 
pnlRelationships.KeepTogether = false;
pnlRelationshipInstance.KeepTogether = false;
pnlQuestionAnswers.KeepTogether = false;
listQuestionAnswer.KeepTogether = false;
listRelationship.KeepTogether = false;
listRelationshipInstance.KeepTogether = false;
 
detail.KeepTogether = false;
0
Steve
Telerik team
answered on 17 Nov 2010, 05:55 PM
Hello Joshua,

Check out the following KB article that elaborates on why your report might end up with blank pages: Problem: Telerik Reporting renders blank pages.
If you are still having problems with the unused space when you've hidden an item, please prepare a sample runnable project, open a support ticket and attach it there. Once we review it, we would be able to provide you with more info.

All the best,
Steve
the Telerik team
See What's New in Telerik Reporting in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
Tags
General Discussions
Asked by
Joshua Kent
Top achievements
Rank 2
Answers by
Steve
Telerik team
Joshua Kent
Top achievements
Rank 2
Share this question
or