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

Report Growing in size to fit data

5 Answers 362 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 27 Jun 2014, 02:31 PM
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








5 Answers, 1 is accepted

Sort by
0
Craig
Top achievements
Rank 1
answered on 27 Jun 2014, 02:49 PM
Here are the screenshots.
0
Nasko
Telerik team
answered on 02 Jul 2014, 12:07 PM
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.

 
0
Craig
Top achievements
Rank 1
answered on 02 Jul 2014, 02:38 PM
Thanks for the timely feedback!

What you had suggested works like a charm.

0
Craig
Top achievements
Rank 1
answered on 07 Oct 2014, 01:19 PM
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"

0
Accepted
Nasko
Telerik team
answered on 10 Oct 2014, 08:29 AM
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.

 
Tags
General Discussions
Asked by
Craig
Top achievements
Rank 1
Answers by
Craig
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or