Adding additional sql parameters

Stimulsoft Reports.WEB discussion
Post Reply
Brix
Posts: 14
Joined: Wed Jul 07, 2010 7:10 am
Location: Utrecht

Adding additional sql parameters

Post 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
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Adding additional sql parameters

Post 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.
Post Reply