ReportParameters in bindings

2 posts, 0 answers
  1. Joel
    Joel avatar
    174 posts
    Member since:
    Oct 2006

    Posted 21 Jul 2011 Link to this post

    Is is possible to access ReportParameters in bindings?  I am trying to avoid adding a column to my dataset with a single value, but am having some difficulties.

    I have a function
        Public Shared Function GetStarValue(ByVal _Metric As Double, ByVal _ValType As Int32) As String
            If _ValType = -1 Then 
                Return "*"
                Return CStr(FormatNumber(_Metric, 1))
            End If
        End Function

    Called via a binding for a textbox works fine:
    =GetStarValue(cdbl(Fields.MyScore), -1)

    this does not
    =GetStarValue(cdbl(Fields.MyScore), cint(ReportParameters(1).Value))

    debug Textbox on the page populated with the following correctly shows -1 so the value is available:
     TextBox5.Value = ReportParameters(1).Value

    Error is:
    An error has occurred while processing TextBox 'TextBox1':
    The expression contains undefined function call ReportParameters().

    Is it possible to access parameters in this way, if not, any alternatives other than adding 1000 rows of "-1" to my dataset?

  2. Steve
    Steve avatar
    10941 posts

    Posted 22 Jul 2011 Link to this post

    Hi Joel,

    As duly noted in our documentation (see Using Report Parameters in Expressions), report parameters are referenced with the keyword =Parameters e.g. =Parameters.VendorSelect.Value.
    Indexing is not supported in expressions but would work if you use parameters programmatically.

    Generally whenever you need a predefined column with either constant value or some expression, use Calculated Fields.

    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top