[英]SSRS Report builder LENGTH expression & size specific field
I'm trying to build a bank file using SSRS report builder (3.0). 我正在尝试使用SSRS报表生成器(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). 我试图获取一个长度表达式以在支票号码字段上工作,但是LEN(Field)
不起作用(无论字段的实际长度如何,都将返回4作为值)。 And LENGTH(Field)
gives me an error: LENGTH(Field)
给我一个错误:
The Value expression for the textrun 'Textbox15.Paragraphs[0]. textrun'Textbox15.Paragraphs [0]的值表达式。 TextRuns[0\\' contains an error: [BC30451] Name 'LENGTH' is not declared* TextRuns [0 \\'包含错误:[BC30451]未声明名称'LENGTH'*
Thanks for the help. 谢谢您的帮助。
Edit: using a SQL server DB 编辑:使用SQL Server数据库
I don't know on which database you are working if you are using sql server then try LEN function and LENGHT in oracle. 如果您使用的是SQL Server,我不知道您在哪个数据库上工作,然后在oracle中尝试LEN函数和LENGHT。
I think you first convert it into integer if it's character and then try len function. 我认为您首先将其转换为整数(如果是字符),然后尝试len函数。
For the length issue: 对于长度问题:
There are two ways to get string length 有两种获取字符串长度的方法
Using the LEN function 使用LEN功能
= LEN(Fields!myfield.Value)
Using the length property 使用length属性
= Fields!myfield.Value.Length
If your field is not a string, try converting first by using the Cstr function 如果您的字段不是字符串,请尝试首先使用Cstr函数进行转换
= 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 14位数字
= "00000000000000"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.