cancel
Showing results for 
Search instead for 
Did you mean: 

Parameters in GridView.

Madesh
New Contributor III

I am trying to create a dashboard with GridView as the component. In Gridview am using Dataadapter (SQL Query). I want to pass parameter to the GridView when displaying the data in the dashboard.

Can someone help me on this.

 

Thanks & Regards,

Madesh K

1 ACCEPTED SOLUTION

ChristianW
OneStream Employee
OneStream Employee

Sorry I thought, the gridview is the triggering object, but you are looking for a way to change the query using a parameter.

If you have a sql data adapter, you can use the parameters in the sql script like here:

ChristianW_0-1642431226969.png

I hope, this is what you are looking for?

In the sample, Onestream replaces

|!WFProfileCriteria_TCR!|

with the parameter's value:

= 'Houston.Register'

and executes the query with this where statement:

... WHERE XFW_TCR_Register.WFProfileName = 'Houston.Register'  ...

View solution in original post

8 REPLIES 8

ChristianW
OneStream Employee
OneStream Employee

There is a Bound Parameter option in the sql table editor:

ChristianW_0-1642422139285.png

and an Column name for bound parameter option to define the column of the  table, that will populate the parameter:

ChristianW_1-1642422228362.png

You only can populate the parameter with one column only.

Madesh
New Contributor III

Thanks Christian. 
Hope this option is available when using SQL table editor. Is there any option available in GridView?

ChristianW
OneStream Employee
OneStream Employee

yes, these options are in sql table editor and in grid view. The screenshots are from a sql table editor.

Madesh
New Contributor III

Hi Christian, i have tried the same in GridView but its not working. Is there any KB article for this to go-through.

ChristianW
OneStream Employee
OneStream Employee

Sorry I thought, the gridview is the triggering object, but you are looking for a way to change the query using a parameter.

If you have a sql data adapter, you can use the parameters in the sql script like here:

ChristianW_0-1642431226969.png

I hope, this is what you are looking for?

In the sample, Onestream replaces

|!WFProfileCriteria_TCR!|

with the parameter's value:

= 'Houston.Register'

and executes the query with this where statement:

... WHERE XFW_TCR_Register.WFProfileName = 'Houston.Register'  ...

Madesh
New Contributor III

Hi Christian,

Thank you so much. Yes, i was looking for the same. I applied the same in my query and it worked.

Thanks & Regards,

Madesh K

It is better to use a Dashboard data set rule when trying to pass parameters into a SQL query. What Christian suggested will work. However, if the parameter is not resolved, this can create errors. Where in which the rule, you can check whether the parameter containssubvars and trigger the SQL or return an empty datatable.

Madesh
New Contributor III

Thank you!
Yes i agree your point. I will apply this in my dashboard.