在我的 Crystal 报告中,我注意到从表中拉出的字段之一具有特殊字符。更具体地说,回车和制表符。有没有办法去掉它,这样它就不会在我的报告中显示为空白?
提前致谢。
最佳答案
这应该这样做:
stringvar output := {TABLE_NAME.FIELD_NAME};
output := Trim(output); //get rid of leading & trailing spaces
output := Replace(output,Chr(13),''); //get rid of line feed character
output := Replace(output,Chr(10),''); //get rid of carriage return character
//add any other special characters you want to strip out.
如果您有很多字符要删除,则可以使用这种稍微高级的方法。只需将您想要删除的任何字符添加到 in[] 中:
stringvar input := {DROPME.TEST_FIELD};
stringvar output := '';
numbervar i;
input := Trim(input);
for i := 1 to Length(input) Step 1 do
if not(input[i] in [Chr(13),Chr(10)]) then
output := output + input[i];
output
关于crystal-reports - Crystal 报表 11 : How to handle or trim special characters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/398260/