Collapse empty sections (height)

6 posts, 0 answers
  1. Joshua Kent
    Joshua Kent avatar
    15 posts
    Member since:
    Nov 2009

    Posted 08 Nov 2010 Link to this post

    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.
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 11 Nov 2010 Link to this post

    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
  3. DevCraft banner
  4. Joshua Kent
    Joshua Kent avatar
    15 posts
    Member since:
    Nov 2009

    Posted 11 Nov 2010 Link to this post

    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);
    }
  5. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 12 Nov 2010 Link to this post

    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
  6. Joshua Kent
    Joshua Kent avatar
    15 posts
    Member since:
    Nov 2009

    Posted 15 Nov 2010 Link to this post

    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;
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 17 Nov 2010 Link to this post

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