Reputation: 21
I'm trying to build a bank file using SSRS report builder (3.0). I'm running into two issues:
LEN(Field)
doesn't work (returns 4 as the value regardless of the actual length of the field). And LENGTH(Field)
gives me an error:
The Value expression for the textrun 'Textbox15.Paragraphs[0]. TextRuns[0\' contains an error: [BC30451] Name 'LENGTH' is not declared*
Thanks for the help.
Edit: using a SQL server DB
Upvotes: 2
Views: 12730
Reputation: 10066
For the length issue:
There are two ways to get string length
Using the LEN function
= LEN(Fields!myfield.Value)
Using the length property
= Fields!myfield.Value.Length
If your field is not a string, try converting first by using the Cstr function
= LEN( Cstr(Fields!myfield.Value) )
= Cstr(Fields!myfield.Value).Length
For the formatting issue:
For numeric fields set the cell format expression to have as many zeros as required eg. for 14 digit numbers
= "00000000000000"
Upvotes: 3
Reputation: 39
I don't know on which database you are working if you are using sql server then try LEN function and LENGHT in oracle.
I think you first convert it into integer if it's character and then try len function.
Upvotes: 0