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

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

18 Answers 164 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 20 Jul 2016, 10:45 AM

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

18 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 22 Jul 2016, 11:46 AM
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
0
Ron
Top achievements
Rank 1
answered on 24 Jul 2016, 12:52 PM

Hi

I am getting an error:

Index out of range,Must be....

 

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

 

 

0
Ron
Top achievements
Rank 1
answered on 24 Jul 2016, 12:56 PM

not even this 

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

0
Stef
Telerik team
answered on 25 Jul 2016, 01:00 PM
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
0
Ron
Top achievements
Rank 1
answered on 26 Jul 2016, 09:10 AM

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.

 

0
Stef
Telerik team
answered on 27 Jul 2016, 12:13 PM
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
0
Ron
Top achievements
Rank 1
answered on 31 Jul 2016, 08:16 AM

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.

 

 

0
Nasko
Telerik team
answered on 03 Aug 2016, 11:33 AM
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
0
Ron
Top achievements
Rank 1
answered on 03 Aug 2016, 11:36 AM

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)

 

0
Nasko
Telerik team
answered on 03 Aug 2016, 11:54 AM
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
0
Ron
Top achievements
Rank 1
answered on 03 Aug 2016, 12:47 PM

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

0
Katia
Telerik team
answered on 05 Aug 2016, 03:00 PM
Hello Ron,

Use RowNumber field which is of type 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
0
Ron
Top achievements
Rank 1
answered on 07 Aug 2016, 06:44 AM

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

0
Katia
Telerik team
answered on 09 Aug 2016, 01:38 PM
Hello Ron,

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

Test converting the value of RowNum field to Integer using () 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
0
Ron
Top achievements
Rank 1
answered on 09 Aug 2016, 01:45 PM

[quote]Ron said:

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

[/quote]

0
Katia
Telerik team
answered on 10 Aug 2016, 01:05 PM
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
0
Ron
Top achievements
Rank 1
answered on 11 Aug 2016, 06:30 AM

Hi

 

I cant open support ticket since my Subscription  has expired.

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

Ron

0
Katia
Telerik team
answered on 12 Aug 2016, 03:08 PM
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
Tags
General Discussions
Asked by
Ron
Top achievements
Rank 1
Answers by
Stef
Telerik team
Ron
Top achievements
Rank 1
Nasko
Telerik team
Katia
Telerik team
Share this question
or