Populate ListBox with Stored Proc by passing Query parameter
Hi,
I am calling a MySQL stored procedure to get data. The idea is to pass a query parameter via script, get data and populate a listbox control by binding the DataColumn via GetColumnValue to the data the proc returns.
Code:
call storedProc (@Parameter1)
Now if I want to pass the parameter value via script, as per the forum posts, a query parameter cannot be passed. Therefore we use a "report" parameter
My steps:
Parameter1 , type String, Expression: [Parameter1]
defined in the query parameter window
Parameter1, type String, Expression: [Parameter1]
defined in Data|Parameter
When I execute the SetParameter Value via the script, like so: Report.SetParameterValue ("Parameter1", "abc") in the Form Load event, nothing happens.
The parameter value "abc" is not passed to my query. What am I doing wrong? I am doing all this via script in the report.
Please help. Do I have to load the report first (even if I'm working via script?)
I am calling a MySQL stored procedure to get data. The idea is to pass a query parameter via script, get data and populate a listbox control by binding the DataColumn via GetColumnValue to the data the proc returns.
Code:
call storedProc (@Parameter1)
Now if I want to pass the parameter value via script, as per the forum posts, a query parameter cannot be passed. Therefore we use a "report" parameter
My steps:
Parameter1 , type String, Expression: [Parameter1]
defined in the query parameter window
Parameter1, type String, Expression: [Parameter1]
defined in Data|Parameter
When I execute the SetParameter Value via the script, like so: Report.SetParameterValue ("Parameter1", "abc") in the Form Load event, nothing happens.
The parameter value "abc" is not passed to my query. What am I doing wrong? I am doing all this via script in the report.
Please help. Do I have to load the report first (even if I'm working via script?)
Comments
You shouldn't set the Expression here - you will get infinite loop when trying to calculate the parameter value.
Try to do that in the report's StartReport event.
BTW, to populate a ListBox with column values, you may use Data Filtering as described in the user's manual ("Dialogue forms/Automatic filtering - how it works", and the next chapters).