知识库

推荐内容

快逸做的更好

产品优势

您的位置: 首页 > 知识库 > 设计基础 > 在数据分隔符中使用转义字符

在数据分隔符中使用转义字符

导出txt文件的时候,可以通过textDataSeparator设置分隔符。但是在这里不能使用转义字符,例如:
<report:html name=”report1″
reportFileName=”…”
funcBarLocation=”top”
needSaveAsText=”yes”
textDataSeparator=”\n”
/>
这样导出的txt文件中包含的都是字符串”\n”,而不是期望的回车符。
要使用转义字符作数据分隔符,可以这样实现:
<%
String sep = “\n”;
%>
<report:html name=”report1″
reportFileName=”…”
funcBarLocation=”top”
needSaveAsText=”yes”
textDataSeparator=”<%=sep %>”
/>

本文标签:
发布日期:2008/07/14
本文分类: 设计基础