Skip to Content
avatar image
Former Member

Dynamic Parameter Datasource

Hi,

I have an application that reads through the parameters in a report, gathers information about the parameter and displays various lookups within my own UI to allow the user to select/enter parameter values for the report to use.

I am experiencing an issue with dynamic parameters on end user PCs. Specifically, i have the following code that retrieves the "'FieldID" from the parameter attributes collection. Using this i can then query the relevant field in the database and populate my lookup control with the correct relevant data.

    For Each crParameter As ParameterFieldDefinition In crParameterFieldDefinitions
            If crParameter.Attributes IsNot Nothing AndAlso crParameter.Attributes.ContainsKey("FieldID") Then
                Dim objAttributes As Hashtable = crParameter.Attributes
                dtParameters.Rows.Add(crParameter.Name, crParameter.PromptText, crParameter.ValueType, crParameter.DiscreteOrRangeKind, objAttributes("FieldID"))
            Else
                dtParameters.Rows.Add(crParameter.Name, crParameter.PromptText, crParameter.ValueType, crParameter.DiscreteOrRangeKind, "")
            End If
        Next

On my development PC, where a parameter has been set as Dynamic, and a datasource specified, the attributes collection contains a "FieldID" and consequently populates my datatable with the value. On anything other than my development PC, it doesn't. Having done various things to try and debug the issue, it appears that on other PCs, the "FieldID" key is not in the attributes collection.

Can anyone provide me with any advise on how to get around this issue? Or an alternative method of determining the field that is used in the dynamic parameter?

Thanks

Stuart

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Sep 14, 2017 at 02:11 PM

    Does it work in my app?

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 06, 2017 at 04:50 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Don

      Had a go with process monitor, and nothing was obviously standing out, i could see if going through the data the same on both machine, but nothing stood out as far as issues/error messages went.

      Both my machine and the client are referencing a SQL Express 2016 database.

      I had a go with .TestConnectivity and all tables returned true.

      Do you have any other ideas or things i could try?

      Thanks

      Stuart

  • Sep 12, 2017 at 03:23 PM

    How is the Report connecting to SQL Express?

    Did you install the same version of CR for VS runtime on the users PC?

    You should be using the MS SQL Native 11 Client dll to connect in CR Designer, is that client installed also?

    Don

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Ok - remapped my report to use MS SQL Native 11 Client. Checked sqlncli11.dll is installed on client pc, and unfortunately still getting the same issue.

  • Sep 12, 2017 at 03:55 PM

    Bizarre...

    Could be User related, try right clicking on your App and selecting Run As Administrator.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Don,

      I did not make any changes to your app, i changed my app to match the code in the 2 sub-routines referenced above from your app.

      Cheers

      Stuart