动态列

时间:2009-03-10 19:34:20

标签: reporting-services

这是我的问题。我传递了一个参数,让它说它叫ShapesSelectedShapeSelected = ",Square, Triangle, Circle,"
问题是ShapeSelected可能是任何形状,因此永远不会static

基于此参数,我想在报告的表格右侧添加3列。这可能吗?我已经在报告属性中的Custom Code开始对其进行编码,但我仍然不知道如何添加列。

Public Function GetReportShapes( ByVal ShapesSelected As String )                 
    Dim Shapes() As String
    Dim result As String
    Dim i As Integer

    Entities = Split(ShapesSelected ,", ")

    For i = 0 To UBound ( Shapes)
             Select case Shapes(i)
               case "Square": 'add Square Column here
                    case "Rectangle": add Rectange Column here  
               case "Triangle": add Triangle Column here
        End Select  
    Next i

End Function

这样渲染列如下:

Square  Triangle   Circle

1 个答案:

答案 0 :(得分:1)

添加您需要的所有列,并使用隐藏或可见属性(我忘记了哪些)和vb表达式来打开和关闭它们。