Reporting WPF - Hide some axis X labels in CategoryScale series.

19 posts, 0 answers
  1. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 20 Jul Link to this post

    Hi

    I am using reporting v.7.1.13.612

    I have a graph with one line series, the Y axis is Numeric and the X axis is Category(numbers also).

    When I have a lot of records I want to hide some of the category labels since it looks bad.

    I found only a way to do that with Chart class but not with Graph class.

    Thanks

    Ron

  2. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 22 Jul Link to this post

    Hi Ron,

    when an axis' Sclae is a CategoryScale, labels are produced for each value of the field used as Graph>CategoryGroups>Grouping. You can control these labels by using a custom expression for the Graph>CategoryGroups>Label property.

    For example:
    =IIf(Fields.DepartmentID%4=0, Fields.Name,"")


    There is also a LabelAngle property of the axis, allowing you to rotate the text.


    I hope this helps.

    Regards,
    Stef
    Telerik by Progress
    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
  3. DevCraft banner
  4. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 24 Jul in reply to Stef Link to this post

    Hi

    I am getting an error:

    Index out of range,Must be....

     

    = IIf(Fields.RowNumber % 5 = 0, Fields.RowNumber,"")

     

     

  5. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 24 Jul in reply to Ron Link to this post

    not even this 

    = IIf(CInt(Fields.RowNumber) %5=0, Fields.RowNumber,"")

  6. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 25 Jul Link to this post

    Hello Ron,

    Please post test data and the code for generating the report in preview.

    Regards,
    Stef
    Telerik by Progress
    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
  7. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 26 Jul in reply to Stef Link to this post

    attached the reportprint screen I cant attach the report to the message.

    selecting some messure and giving it the rowNumber of the result query using sqlite.

     

  8. Stef
    Admin
    Stef avatar
    3047 posts

    Posted 27 Jul Link to this post

    Hi Ron,

    You can find attached a TRDX file that can be opened by the Standalone Report Designer of Telerik Reporting Q1 2013 SP1 and later. Please compare the data structure and Graph settings to yours.

    The SqlDataSource component uses a connection to AdventureWorks database, where DepartmentId field is of Integer type.

    Regards,
    Stef
    Telerik by Progress
    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
  9. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 31 Jul in reply to Stef Link to this post

    Can you add RowNumber to the Query like this:

    select *,(select COUNT(0) from humanresources.department e2 where e2.Id <= Dep.Id) as 'RowNum' from humanresources.department As Dep

    And use the filter, you sent me, on this field.

     

     

  10. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 03 Aug Link to this post

    Hello Ron,

    Please find attached a correctly working sample report which includes the requested modifications.

    Regards,
    Nasko
    Telerik by Progress
    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
  11. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 03 Aug Link to this post

    I get an error.

    Telerik.Reporting.Xml.XmlSerializerExcepion: An error has occurred during xml serialization. The xml serializer cannot resolve type with name: Report
       at Telerik.Reporting.Xml.ObjectXmlReader.ReadXmlElement(String name)
       at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.ReadReport()
       at Telerik.ReportDesigner.Packages.ReportDesigner.Serialization.ReportDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)

     

  12. Nasko
    Admin
    Nasko avatar
    909 posts

    Posted 03 Aug Link to this post

    Hello Ron,

    The report was saved with the latest version of the Telerik Reporting Standalone Report Designer. If you are using an older version, please download the report attached to this reply which has been downgraded to Q1 2013 SP1.

    Regards,
    Nasko
    Telerik by Progress
    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
  13. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 03 Aug in reply to Nasko Link to this post

    I still getting an error when adding the filter to the label.

    I also have other data in the graph group. How your graph do the grouping if you didnt punt any in the Grouping field ?

    Since the reporting doesn't give you any dam info about what is the problem, attached video of it:

    https://drive.google.com/file/d/0B7HpLbCZWGdUUmk5a1BYUEFteFk/view

    Ron

  14. Katia
    Admin
    Katia avatar
    307 posts

    Posted 05 Aug Link to this post

    Hello Ron,

    Use RowNumber field which is of type Integer not Object. You can also use built-in RowNumber() function, for example:
    = IIf(RowNumber() % 4 = 0, Fields.Name, "")


    Regards,
    Katia
    Telerik by Progress
    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
  15. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 07 Aug in reply to Katia Link to this post

    Hi Katia,

    I tried to use the RowNumber() function but I get an error :
    Unable to cast object of type "Telerik.Reporting.Expressions.AggergateNote" to type "Telerik.Reporting.Expressions.FieldsNode"
    How can I use RowNumber as Int and not as object? I also tried cast which result in error also.
    How can I spesified that the RowNumber fied is type int so the reporting will know its int and not object? I added the RowNumber query in the previous posts.

     

    Thanks

    Ron

  16. Katia
    Admin
    Katia avatar
    307 posts

    Posted 09 Aug Link to this post

    Hello Ron,

    To be able to use the suggested expression with RowNumber() you need to update to a newer version, otherwise the error will be thrown.

    Test converting the value of RowNum field to Integer using CInt() built-in function, for example:
    = IIf(CInt(Fields.RowNum) % 4 = 0, Fields.Name,"")


    Regards,
    Katia
    Telerik by Progress
    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
  17. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 09 Aug in reply to Katia Link to this post

    Ron said:

    Posted 24 Jul 
    not even this 
    = IIf(CInt(Fields.RowNumber) %5=0, Fields.RowNumber,"")

  18. Katia
    Admin
    Katia avatar
    307 posts

    Posted 10 Aug Link to this post

    Hello Ron,

    Unfortunately, it is not clear what is causing the error in your scenario. You can compare your settings with those provided in a sample attached earlier.
    Also, test using a RowNumber field which is of type Integer.

    To provide you further suggestions please attach the problematic report definition together with test data in a support ticket.


    Regards,
    Katia
    Telerik by Progress
    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
  19. Ron
    Ron avatar
    14 posts
    Member since:
    Dec 2012

    Posted 11 Aug in reply to Katia Link to this post

    Hi

     

    I cant open support ticket since my Subscription  has expired.

    How can I send you the data in a private mode ?

    Ron

  20. Katia
    Admin
    Katia avatar
    307 posts

    Posted 12 Aug Link to this post

    Hello Ron,

    The files can only be attached to the support ticket. You can check the support plans to look for the option that gives you the possibility to submit a ticket.

    Another option could be to upgrade the product and test using the built-in RowNumber() function.


    Regards,
    Katia
    Telerik by Progress
    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
DevCraft banner