Crystal Reports:向字符串追加空格

时间:2008-12-17 11:00:23

标签: crystal-reports

我的报告中有一个字段需要长度为40.如果字符串不是那么长,我需要添加一些空格。

感谢。

2 个答案:

答案 0 :(得分:3)

按照

的方式尝试

if length({yourfieldname here})< 40 然后    {yourfieldnamehere} + space(40 - length({yourfieldnamehere})) 其他 {yourfieldnamehere}

答案 1 :(得分:2)

将40个空格附加到变量并获取结果字符串的前40个字符。

这样的东西
mid( (yourfield + space(40)), 1, 40) 

应该有效。