将删除并替换在MS SQL报告构建器中
一个字段给我以下字符串:
#$ texta#$ textb#$ textc
我想删除#$ - chars,然后通过新行将值分开。此外,我想替换特殊字符(&)。最后看起来应该像这样:
texta
textb
textc
因此我使用此代码:
=Replace(Replace(Fields!My_Field.Value,"&","&"),"#$",Environment.NewLine)
字符串以#$开头,因此此代码在开始时就制作了一条新行,我想通过使用此代码避免使用:
=Right(First(Fields!My_Field.Value, "DATASET"), Len(First(Fields!My_Field.Value, "DATASET"))-2)
我想在 >替换功能开始。我的问题是,我不知道如何结合这两个功能以正常工作。
A field gives me the following string:
#$TEXTA#$TEXTB#$TEXTC
I want to remove the #$-chars and seperate the values by a new line. In addition I want to replace special characters (&). In the end it should look like this:
TEXTA
TEXTB
TEXTC
So I use this code:
=Replace(Replace(Fields!My_Field.Value,"&","&"),"#quot;,Environment.NewLine)
The string starts with #$, so this code makes a new line in the beginning, which I want to avoid by using this code:
=Right(First(Fields!My_Field.Value, "DATASET"), Len(First(Fields!My_Field.Value, "DATASET"))-2)
I want to remove the first two chars before the replace function starts. My problem is, that I dont know how to combine these two functions to work properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有测试此问题。...
我认为您应该能够用第二个表达式在第一个表达式中替换对第一个表达式中对该字段的参考。
Without testing this....
I think you should just be able to replace your reference to the field in your first expression, with your second expression, like this.