SQL Server Performance

Custom Code

Discussion in 'SQL Server Reporting Services' started by sfinc, Mar 4, 2004.

  1. sfinc New Member

    When in the context of Custom Code, can global collections be accessed?

    I'll trying to access the Parameters collection but was given the following error

    C:Documents and SettingsshoyMy DocumentsVisual Studio ProjectsWindowsApplication1Report Project1external_user.rdl There is an error on line 4 of custom code: [BC30469] Reference to a non-shared member requires an object reference.

    The code is:
    Public Function FormatData(format As String, value As String) As Object
    Dim formatted As Object
    Select format
    Case "Date"
    If Not value = "" Then
    formatted = Parameters("Culture").Value
    ' formatted = Convert.ToDateTime(value).ToShortDateString()
    End If
    Case Else
    formatted = value
    End Select
    Return formatted
    End Function

    Siew Fai.
  2. unclebiguns New Member

    It looks to me like you have to reference the parameters collection through the report, i.e. Report.parameters("Culture").Value[8D]

    Jack Corbett, DBA
    Nexfor Fraser Papers

Share This Page