Change a text of query when report rendering
Hasitha
Sri Lanka
Hi,
Is there any way to change a text of query when report rendering? For example by passing part of the query through parameters and joining when report rendering.
For example:
Select * From Customers Where Code= {myparam}
Select * From Customers Where {myparam}
Select * From Customers {myparam}
Select * From {myparam} where code=1
Thanks in advance,
Hasitha.
Is there any way to change a text of query when report rendering? For example by passing part of the query through parameters and joining when report rendering.
For example:
Select * From Customers Where Code= {myparam}
Select * From Customers Where {myparam}
Select * From Customers {myparam}
Select * From {myparam} where code=1
Thanks in advance,
Hasitha.
Comments
Use the following code (may be in the Report.StartReport script event):
TableDataSource table = Report.GetDataSource("MyTable") as TableDataSource;
table.SelectCommand = "select * from ...";