代码之家  ›  专栏  ›  技术社区  ›  Jeff

基于其他参数设置的Reporting Services动态参数内容

  •  0
  • Jeff  · 技术社区  · 17 年前

    在Reporting Services中,是否可以基于在其他参数中选择的值填充参数?我们正在寻找在一个做了很多工作的遗留报告平台中替换一组现有的报告。

    2 回复  |  直到 8 年前
        2
  •  0
  •   vick    8 年前

    公共共享函数removeduplicates(参数作为参数)作为字符串()。 dim items as object()=参数.value

        System.Array.Sort(items) 
    
        Dim k As Integer = 0
    
        For i As Integer = 0 To items.Length - 1
            If i > 0 AndAlso items(i).Equals(items(i - 1)) Then
                Continue For
            End If
        items(k) = items(i)
        k += 1
        Next
    
        Dim unique As [String]() = New [String](k - 1) {}
        System.Array.Copy(items, 0, unique, 0, k)
    Return unique
    

    端函数

    公共共享函数buildList(byval variablename as string,byval paramvalues as object())as string 将InsertStatements变暗为新的System.Text.StringBuilder() 将每个参数值作为参数值中的对象 insertstatements.appendline(string.format(“insert 0 values('1')”,variablename,paramvalue)) 接下来 返回InsertStatements.ToString()。 端函数

    公共函数createLabel(byval month as integer,byval index as integer)as string dim year as integer=现在.年

    If month <= 0 Then
        month   = month + 12
        year    = year - 1
    End If
    
    If month - index > 0 Then
        Return MonthName(month - index) & " " & year
    Else 
        Return MonthName(month  + (12 - index)) & " " & year -1
    End If
    

    端函数

    公共函数createValue(byval month as integer,byval index as integer)as string dim year as integer=现在.年

    If month <= 0 Then
        month   = month + 12
        year    = year - 1
    End If
    
    
    If month - index > 0 Then
        Return RIGHT("0" & month - index,2)  & year
    Else 
        Return RIGHT("0" & month  + (12 - index),2)  & year -1
    End If
    

    端函数

    推荐文章