Skip to Content
0

Dynamic Parameter Datasource

Sep 06, 2017 at 04:50 PM

73

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Don Williams
Sep 14, 2017 at 02:11 PM
0

Does it work in my app?

Share
10 |10000 characters needed characters left characters exceeded
Don Williams
Sep 06, 2017 at 04:50 PM
0
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Don,

Thanks for coming back to me. I have downloaded the example project and made the relevant changes to match up with the getDiscreteValues and getRangeValues routines in your example, but am still experiencing the same behaviour.

On my machine, it returns the FieldID, but on my test client environment it returns NULL.

I guess there is something i need to do beforehand to tell the report which database it needs to be logged in to possibly? I have been through and set all the table log on info for each table in the report, but guess that doesn't have any impact on the parameters?

Share
0

Try using ProcessMonitor on the Client PC and compare runtime.

It may be the DB Client is different or it's failing to log on first.

You can also add a .TestConnectivity() and see if it works.

Don

0
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

0
Don Williams
Sep 12, 2017 at 03:23 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I'm connecting using the 'Microsoft OLE DB Provider for SQL Server'.

CR for VS runtime is the same on my pc and client pc.

I'll try using the MS SQL Native 11 connection and see how i get on with that, and ensure its installed on the client also.

Thanks for your help so far. I'll let you know how i get on!

0
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.

0
Don Williams
Sep 12, 2017 at 03:55 PM
0

Bizarre...

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

Show 4 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Very!

I am logged in as a domain admin on the client pc, but chose the 'Run as Administrator' option to test and still the same issue.

I think i'll create a new report from scratch using the MS SQL Native 11 client connection rather than remapping an existing report, just to rule out anything being left behind from the old connection that could be interfering.

After that i assume we're not left with alot of options though?

0
Former Member

No luck with a new report either - v frustrating!

0

You wrote this:

Stuart Rowcliffe yesterday

Hi Don,

Thanks for coming back to me. I have downloaded the example project and made the relevant changes to match up with the getDiscreteValues and getRangeValues routines in your example, but am still experiencing the same behaviour.

You should not need to change anything in my app, just log on and then select the Parameters from the drop down.

Don

0
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

0