问题描述
在报表生成器中,我有一个使用 lookupset 函数的表达式,它可以不返回任何内容、日期和描述,或者几个日期和几个描述.它提取的数据是正确的.我已经搜索了这个论坛和 MSDN.使用我在两个地方找到的内容,我将我的表达调整为以下内容.
我的表情:
=Join(Lookupset(Fields!ProjectName.Value,字段!项目名称.值,Fields!TaskBaseline0FinishDate.Value &"- " &Fields!TaskName.Value,"DsActivitiesCompleted"))
然而,当显示这个时它没有回车,它只是一个接一个地放置.示例如下:
08/05/2015 – 里程碑:启动会议完成 08/18/2015 – 里程碑:PMT 测试计划完成 08/26/2015 – 里程碑:设置 CCD 日期 08/26/2015 – Sprint 0 完成 09/18/2015 年 - 里程碑:第 1 波完成 09/28/2015 - 里程碑:第 2 波完成
我希望它看起来像下面.如果可能的话,我也希望在每行前面都有要点.
我的问题是如何以上述格式获取它?
谢谢,MM
您错过了
更新
使用下面的代码也可以使用 Chr(183) 作为每个新行的项目符号
=" " + Chr(183) + " " +加入(Lookupset(字段!项目名称.值,字段!项目名称.值,Fields!TaskBaseline0FinishDate.Value &"- " &Fields!TaskName.Value,"DsActivityCompleted"),vbCrLf + " " + Chr(183) + " ")
In Report Builder, I have an expression using the lookupset function that pulls back either nothing, a date and description, or several dates and several descriptions. The data it is pulling is correct. I have searched this forum and MSDN. Using what I've found in both places, I have tweaked my expression to the following.
My expression:
=Join(Lookupset(Fields!ProjectName.Value,
Fields!ProjectNames.Value,
Fields!TaskBaseline0FinishDate.Value & " - " & Fields!TaskName.Value,
"DsActivitiesCompleted"))
However, when this is displayed it doesn't have a carriage return, it just puts one after another after another. Example Below:
What I want it to look like is below. If possible I would like to have bullet points in front of each line as well.
My question is how do I get it in the format above?
Thanks,MM
You have missed the final (optional) argument of JOIN which states which character you want to use to join your string together. Changing your expression tyo use vbCrLf
(the VB new line code) as follows
=Join(Lookupset(Fields!ProjectName.Value,
Fields!ProjectNames.Value,
Fields!TaskBaseline0FinishDate.Value & " - " & Fields!TaskName.Value,
"DsActivitiesCompleted"),
vbCrLf)
Gives this output
Update
Use the below to use Chr(183) as a bullet character for each new line as well
=" " + Chr(183) + " " +
Join(Lookupset(Fields!ProjectName.Value,
Fields!ProjectNames.Value,
Fields!TaskBaseline0FinishDate.Value & " - " & Fields!TaskName.Value,
"DsActivitiesCompleted"),
vbCrLf + " " + Chr(183) + " ")
这篇关于格式查找表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!