Hi I see that parameters can be specified for the SQL query, example:
stiReport["@countryID"] = "UK";
In this case, the designer has a Parameter called "@countryID" and the data source's query text is "select * from customers where country=@countryID".
What I want to do is to be able to change the whole where clause, not just one item. I want the query text to be "select * from customers @where" and then be able to change the code to say stiReport["@where"] = "where country = 'UK'". Is this possible? What's the best way to accomplish this?
Change the SQL query
Change the SQL query
Hello Jim,
Please check following url:
http://stimulsoft.helpserve.com/index.p ... ticleid=71
Thank you.
Please check following url:
http://stimulsoft.helpserve.com/index.p ... ticleid=71
Thank you.
Change the SQL query
Thank you, it works great. I've changed my sql query string to
Then I used the following code to add in the query variable during runtime, so that the same code will work on different report files without needing to add the variable each time.
Code: Select all
"select * from customers {query}"
Code: Select all
String QueryString = "where country='UK' or country='USA'";
report.Dictionary.Variables.Add(new Stimulsoft.Report.Dictionary.StiVariable("query", ""));
report["query"] = QueryString;
Change the SQL query
Hello Jim,
Ok.
Let us know if you need any additional help.
Ok.
Let us know if you need any additional help.