使用asp.net替换Word报表替换“块字符"(□)回车的问题 [英] Word Report replacing “block character” (□) carriage returns issue using asp.net

查看:98
本文介绍了使用asp.net替换Word报表替换“块字符"(□)回车的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用asp.net生成单词报告.我正在从数据库中导出数据,并将其替换为word文档中的占位符.当我从数据库中检索数据时,字符串包含我要消除的块字符"(□)回车符?我尝试用chr(11),chr(13)替换它,但没有成功.例如,我有以下文字
abc
xyz
那么我得到的当前输出如下:
abc
□xyz
代替
abc
xyz
在文字报告上.您可以为我提供上述问题的解决方案吗?

I am generating word report using asp.net. I am exporting data from the database and replacing it with the placeholders in the word document. When i am retrieving the data from the database the string contains the "block character" (□) carriage returns which i want to eliminate? I have tried replacing it with chr(11), chr(13) but have not got any success. for example i have the following text
abc
xyz
then the current output i am getting is as follows:
abc
□ xyz
instead of
abc
xyz
on word report. Can you please provide me with a solution for the above issue?

推荐答案

尝试使用Environment.NewLine而不是"\ r \ n".
Try using Environment.NewLine rather than "\r\n".


我尝试使用它,但是字符串中仍然存在方框(阻塞字符).还有其他消除屏蔽字符的方法吗?
I have tried using it but the box (blocking character)still exists in the string. Is there any other way to eliminate the blocking character?


这篇关于使用asp.net替换Word报表替换“块字符"(□)回车的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆