Telerik.reporting issues

5 posts, 0 answers
  1. Preeti
    Preeti avatar
    3 posts
    Member since:
    Apr 2015

    Posted 17 Jun 2015 Link to this post

    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.

  2. Preeti
    Preeti avatar
    3 posts
    Member since:
    Apr 2015

    Posted 17 Jun 2015 Link to this post

    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.

  3. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 17 Jun 2015 Link to this post

    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
  4. Preeti
    Preeti avatar
    3 posts
    Member since:
    Apr 2015

    Posted 19 Jun 2015 in reply to Nasko Link to this post

    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!

  5. Nasko
    Admin
    Nasko avatar
    1045 posts

    Posted 22 Jun 2015 Link to this post

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