Page 1 of 1

Adding additional sql parameters

Posted: Thu Jul 08, 2010 7:47 am
by Brix
Hi there,

Is it possible to use additional sql parameters on my report without having to edit the sql query.

For example.

I have an existing report with a query as following:

SELECT Name, Gender, City FROM people

This report is saved into the database.
Now I want to view the report seeing only the men in a specific city. The query then would be like:

SELECT Name, Gender, City FROM people WHERE Gender = 'm' WHERE City = 'Some City'

I don't want to open the report to change the query, but make a change in the url where the report will react to the change in the query.

Thanks in advance

Adding additional sql parameters

Posted: Fri Jul 09, 2010 5:33 am
by Jan
Hello Brix,

You can use following code to change query from code:

Stimulsoft.Report.Dictionary.StiSqlSource source = report.Dictionary.DataSources["MyDataSource"] as Stimulsoft.Report.Dictionary.StiSqlSource;
source.SqlCommand = "select * from customers";

Thank you.