English 中文(简体)
SSRS 报告:当某一领域无效时,在田间之间外加空间
原标题:SSRS Report: Extra space between fields when a field is null

我有一份以下列格式显示成员姓名的报告:先令,先令,先是中,最后是uff。 报告准则认为了这一点:[姓名_prefix][名称_first][名称_middle][名称_last][名称_suffix]

每一外地条目在成员中名时,都有一间空间,而且当中间名称为Null时,在第一个和最后一个名字之间有两个空间。 我试图以这样的表述解决问题:

=IIF(IsNothing(Fields!name_middle.Value),"",Fields!name_middle.Value & " ")

我也调整了间隔,以便看上去:在中名和最后名词之间没有空间的[名号][名号]。 我希望,如果有一个中间名称,在名字之间和中间名称无效时,只有一到最后一个空间。 当有中间名称时,该名称是正确的,但如果中间名称是Null,则还有额外空间。 因此,我尝试了另一种方法,在认为如此的领域之间没有空间:

=IIF(IsNothing(Fields!name_middle.Value)," "," " & Fields!name_middle.Value & " ")

Again same issue, works fine where there is a middle name but two spaces when there is not. I have considered concatenating the entire member name but I think I will have the same result. The same report done with Crystal Reports uses the first method and it works without issue. Thank you in advance.

最佳回答

根据基本数据来源,如果没有中间名称,就有可能将其视作空洞,而不是无效。

我建议修改这一表述如下:

=IIF(IsNothing(Fields!name_middle.Value) OR Len(Fields!name_middle.Value) < 1,
     "",Fields!name_middle.Value & " ")

在实地发现护卫时间长度的良好检验是:

=Len(Fields!fieldName.Value)
问题回答

你在第一行所做的是正确的,我怀疑你正在从一个空间的数据库中找到一个中间名称,这就是为什么它似乎翻了一番。





相关问题
An error has Occurred During Report proccesing

When I m running the report I m getting that message above. The Report Works fine when I press the "Run Report" Button but I want also to avoid that annoying message that appears when the page loads. ...

Reporting services only displaying the last row

I have built a report pretty basic just a table wiht 45 rows of data. Problem is its only showing one row of data and its the last row. It displays just fine in the dataset and proc. any ...

Show Parameters for Reports In SSRS

I m developing an SSRS in Visual Studio BIDS. In it, I have a link that links to another report (report A). Report A has 4 parameters (dates). When I click on that link, it goes to report A fine, but ...

How to add group, or page field in an existing .rdl report

I have several .rdl reports designed for our client. However, they need new ones, that are relatively similar to the old ones. Differences are in the "group" and "page fields" (these can be changed ...

Report rendering using SSRS in Google Chrome

Hey, In our project, we use SSRS integrated with asp.net forms to render reports. The report looks good in IE. when it comes to google chrome, there re some issues we face such as date picker not ...

热门标签