65.9K
CodeProject 正在变化。 阅读更多。
Home

如何从多值中选择要在报表中显示的字段

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.71/5 (4投票s)

2008年3月17日

CPOL
viewsIcon

27243

如何从多值中选择要在报表中显示的字段。

引言

有时,客户希望选择需要在报表中显示的字段。SSRS 可以通过多值参数和自定义代码提供此功能。

  1. 添加一个包含所有需要选择的字段的多值参数。

1.JPG

  1. 添加一个自定义函数。此函数用于查找指定的字段是否被选中。

    2.JPG

  2. 源代码如下:

    public function CheckSelect(byval s1 as integer) as boolean
    CheckSelect=false
    dim i as integer
    i=0
    for i=0 to Report.Parameters!Report_Parameter_0.count()-1 step 1
    if s1=Report.Parameters!Report_Parameter_0.Value(i) then CheckSelect=true
    next i
    end function
  3. 将列的 visibility 属性表达式设置为“=Not Code.CheckSelect(0)”。

历史

  • 2008年3月17日:初始发布
© . All rights reserved.