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

Telerik.reporting issues

4 Answers 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Preeti
Top achievements
Rank 1
Preeti asked on 17 Jun 2015, 06:01 AM

Hi there,

 I am trying to figure out couple of things on reports that are driving me crazy for past few days. Any pointers would be appreciated:

Background-

We are using Telerik.Reporting to display stacked column charts. The data is bound using a stored proc and bound to the chart using declarative properties. The data returned back by sp is fairly simple:

Type  Name Total

T1      N1      20

T1      N2      05

...

T2     N1       03

T2     N3       05

...

The sp parameters are bound to report parameters and we have a filter on Type (i.e. at a given point of time you are viewing the graph for one type). The graph is on Name and total (Y-axis). Now the issues that we have is:

1. Setting individual bar width dynamically - the number of names that can be returned are dynamic, if only two names are returned the individual bar's width is too much making it look ugly. What we would like to accomplish is setting max-width of a bar somehow.

2. Y-axis scale - If we don't set the scale and the Total returned is a small number, it shows the scale in decimal which doesn't make sense for most of our reports (since they are on Person and other whole numbers). I don't want to hard-code the "MajorStep" of Scale to a number since I still want the scale to be adjusted dynamically based on the "Total" that is being returned, so if the "Totals" are 500, 100 I would rather prefer the MajorStep to be 50. Basically, I want to limit the number of Major ticks and then step the Step based on that, something like say I want to have only 10 major ticks and if the highest total returned is 550, I would want to set  my Major step to 550/10 = 55 or somewhere around that.

Let me know if any further information is needed.

4 Answers, 1 is accepted

Sort by
0
Preeti
Top achievements
Rank 1
answered on 17 Jun 2015, 06:17 AM

Couple of more details, we are using

Telerik.reporting 9.0.15 for ASP.Net

and using Telerik.ReportViewer.MVC to integrate it with MVC 5 website.

0
Nasko
Telerik team
answered on 17 Jun 2015, 08:16 AM
Hello Preeti,

You can use Bindings to bind the SpacingSlotCount and MajorStep properties to data from your data source.

The SpacingSlotCount property determines the number of space slots that will be left around the DataPoints per category slot, measured relatively to the DataPoint slot's width: Empty Space = SpacingSlotCount * DataPoint_SlotWidth. It can be used to set the width of the bars in your scenario.

These bindings can be configured within the CoordinateSystem.Bindings property Edit Bindings window.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Preeti
Top achievements
Rank 1
answered on 19 Jun 2015, 03:42 PM

Hi there,

 I tried Bindings and setting SpacingSlotCount to "= Max(Fields.Total)/10" but that doesn't work, even setting to =Max(Fields.Total) doesn't work (where Total is the column returned back in the above query). Hard-coding an integer value like 10 works. The same holds true for setting the Y-Axis.MajorStep to =Count(Fields.Name). Am I doing something wrong?

 Thanks!

0
Nasko
Telerik team
answered on 22 Jun 2015, 12:09 PM
Hello Preeti,

Since both of the Graph properties are of type Double you will need to convert the expression result using the CDbl() conversion function e.g.:

= CDbl(Max(Fields.Total))


Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Preeti
Top achievements
Rank 1
Answers by
Preeti
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or