Report Growing in size to fit data

6 posts, 1 answers
  1. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 27 Jun 2014 Link to this post

    I am currently working on a Range Bar graph that has dates on it.
    It reads data from a database and displays properly, my only problem is that when there is a lot of data the rows (shrink) get very small to allow for all the data to fit.  Is there a way to adjust the rows so that they stay a constant height and the graph itself grows in height to fit all the data points?

    This first image is one that doesnt have many datapoints in it:


    then once I add more data into the database i get this:

    So is there any way to keep the rows a constant height and just increase the total high of the graph to fit the extra data in without making it smaller?

    Thanks








  2. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 27 Jun 2014 in reply to Craig Link to this post

    Here are the screenshots.
  3. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 02 Jul 2014 Link to this post

    Hello Craig,

    The Graph.Height property can be set programmatically based on the amount of records in your database.

    Another approach is to set the height via Binding e.g.:

    Property path: Height
    Expression: =Count(Fields.MyField) + "in"

    This will set the height of the graph to N inches, where N is the number of rows in the data source with MyField != Null.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  4. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 02 Jul 2014 in reply to Nasko Link to this post

    Thanks for the timely feedback!

    What you had suggested works like a charm.

  5. Craig
    Craig avatar
    19 posts
    Member since:
    Jun 2014

    Posted 07 Oct 2014 in reply to Nasko Link to this post

    Nasko, 
    Unfortunately the suggested approach via binding does not work anymore for some odd reason.  We have made some changes to the database.

    I have the following express and it does not change the height of my report, it does absolutely nothing.  The following expression is what i have for binding the Height property of the graph.

    ​Property Path:​ Height
    ​Expression:​ =Count(‪Fields.Duration) + "in"

  6. Answer
    Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 10 Oct 2014 Link to this post

    Hello Craig,

    Note that this approach will only work if the graph parent item's DataSource contains the Fields.Duration data field. This is caused by the fact that the graph DataSource binding is executed against the data scope of the graph's parent data item.

    Please check the attached samples for a demonstration of the approach. You will need the latest version of Telerik Reporting (Q2 2014 SP1) to open and run the reports.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top