水晶报表弄乱了富文本
我有一个字符串以富文本格式保存到 SQL 字段,因此它前面有很多符号,如下所示...
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss \fprq2\fcharset0 Calibri;}{\f1\fnil\fcharset0 Verdana;}} {\colortbl;\red0\green0\blue255;} \viewkind4\uc1\pard\sa200\sl276\slmult1\f0\fs22 Blah Blah Blah \par
我将其作为参数字段传递给 Crystal Reports 11.5,因此数据类型是字符串。然后,我只需将参数拖到报告中即可直接显示它。格式设置的段落选项卡中的解释也设置为 RTF。
我的问题是,它正在删除格式标签,但它却搞乱了文本。它会随机乱码单词并在单词中随机插入字母“i”等字符,它还会在其他单词后面的背景中放置一些随机字母,使其看起来像是手动输入的(如果有意义的话),只是让单词看起来像不可读且粗体,就像有人用打字机打字一样。
我尝试设置一个新的文本对象,然后将富文本参数放入其中以显示,但它不会删除/执行任何富文本格式标记。
什么给?显然,它可以处理富文本,因为它删除了标签,但是如何处理随机插入到单词中的 i 以及一些混乱文本超过其他单词的实例呢?
I have a string that gets saved as rich text to a SQL field, so it has a lot of symbols in front of it like so...
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}{\f1\fnil\fcharset0 Verdana;}}
{\colortbl ;\red0\green0\blue255;}
\viewkind4\uc1\pard\sa200\sl276\slmult1\f0\fs22 Blah Blah Blah \par
I'm passing in this to Crystal Reports 11.5 as a parameter field, so the data type is string. I'm then just displaying it straight up by dragging the parameter to the report. The interpretation is set to RTF also in the paragraph tab of the formatting settings for this.
My problem is, it is removing the formatting tags but it is screwing up the text. It is randomly garbling words and inserting characters like the letter 'i' randomly in words, it's also putting some random letters in the background behind other words, making it look like it's been typed over manually if that makes sense, just makes the word look unreadable and bolded like someone typed over it with a typewriter.
I tried setting a new text object and then putting the rich text parameter in that to display, but then it doesn't remove/do any of the rich text formatting tags.
What gives? It can obviously do rich text as it removes the tags, but what is the deal with the random i's inserted into words and a couple of instances of the jumbled text over other words?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,我还没有使用过 11.5.. 但请尝试一下..
格式字段 >段落选项卡>文本解读> RTF 文本
如果文本重叠,则您可以从 RTF 文本中替换以下控件集。它应该正常工作并且不重叠。
Unfortunately, I haven't used 11.5 yet.. but give this a try..
Format Field > Paragraph tab > Text Interpretation > RTF text
If the text is getting overlapped, then you can replace the following control set from your RTF text. It should work properly and not overlap.