Crystal 报表 11:如何处理或修剪特殊字符

编程入门 行业动态 更新时间:2024-10-22 21:42:22
本文介绍了Crystal 报表 11:如何处理或修剪特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的水晶报表中,我注意到从表格中拉出的一个字段有特殊字符.更具体地说,回车和制表符.有没有办法把它去掉,所以它不会在我的报告中显示为空白?

In my crystal report, I noticed one of the fields being pulled from a table has special characters. More specifically carriage returns and tabs. Is there a way to strip this out, so it doesn't show up blank in my reports?

提前致谢.

推荐答案

应该这样做:

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[]:

If you have a lot of characters to strip out, you can use this slightly fancier approach. Just add whatever characters you want to strip out to the 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 报表 11:如何处理或修剪特殊字符

本文发布于:2023-10-29 10:00:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539402.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何处理   报表   特殊字符   Crystal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!