Wednesday, March 21, 2012

Formatting labels in chart

Hello,

I have one report with chart. And labels of X axis at this chart are too long. How can I format them to show, for example, only 3 first symbols of titles?
As far as I understand, to solve this problem I should use Format property. But I know only about formatting date and numbers, not strings.
Can you help me?

Thank you.

I have a similar problem. The labels are little too long and are shown alternatively on 2 different lines.

Is it possible to have the labels angled at 45 degrees or something?

Thanks for any help!!!

|||To shorten labels i use "substring" in the sql-query..

select label, substring(label,1,5) as shortlabel, value from table (MSSQL)
select label, substr(label,1,5) as shortlabel, value from table (Oracle)

|||

in the Label property do the following.

= Code.getThreeCharsFromMyLabel(Fields!LabelField.Value)

In the code section of the report you could write a function named "getThreeCharsFromMyLabel" that accepts the label string and returns a Substring of the label.

and thats it u get what u want...... :)

|||

Note: you could also just use the =Left(..., 3) function to get the first 3 characters: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctleft.asp

-- Robert

sql

No comments:

Post a Comment