We need to change a SQL command on a DataSource before "report preview" of the StiDesignerControl.
Where can we put this code to change the SQL of the DataSource?
We added this code below on PreviewingReportInDesigner event but the sql changed not affected the report being viewed.
Code: Select all
StiSqlSource sqlSource = (report.Dictionary.DataSources[0] as StiSqlSource);
sqlSource.SqlCommand = "SELECT * FROM TABLE WHERE {MYVARIABLE};