Code: Select all
SELECT ...
FROM MyTable
WHERE {condition}
Code: Select all
StiReport report = new StiReport();
report.Load("...mrt");
report.Dictionary.Variables["condition"] = string.Format("Foo < {0} AND Bar >= {1}", txtFooValue.Text, txtBarValue.Text);
reportViewer.Report = report;
The report correctly shows the subset of data based on the initial values in those TextBoxes, but when the user changes one of the values in these textboxes and clicks a Refresh button, I'd like to update the report so that it queries based on the new values. I am having no luck accomplishing this, however. I have the above code running on every visit to the page and I can step through the code using the Debugger and see that the variable is being assigned the new values in txtFooValue and txtBarValue. But the report that is displayed on the page shows the data with the initial values and is not filtering by the new values. And if I run SQL Server Profiler I see that no query is being sent to the database when the user clicks the Refresh button, even though the above code is running.
Is there some line of code I need to tell the report or StiWebViewer control to refresh?