Page 1 of 1

Setting SQL Statement of Datasource

Posted: Mon Jan 21, 2008 10:13 am
by Stephan1
Hi,

how can i set the SQL Statement for the Datasource in my vb.net code ?.

i use the following lines to use the Parameter

stireport1.CompiledReport.DataSources("WaWi_VKBelegeumsaetze").Parameters("Artikelmatch").ParameterValue = suchabfrage

Instead of using lots of Parameters for data ranges etc, i would like to put my own Select statement together and send it to the reports Datasource.
names "VKBelegeumsaetze".

Thx for helping

stephan

Setting SQL Statement of Datasource

Posted: Mon Jan 21, 2008 10:21 am
by mace242
Stephan1 wrote:Hi,

how can i set the SQL Statement for the Datasource in my vb.net code ?.

i use the following lines to use the Parameter

stireport1.CompiledReport.DataSources("WaWi_VKBelegeumsaetze").Parameters("Artikelmatch").ParameterValue = suchabfrage

Instead of using lots of Parameters for data ranges etc, i would like to put my own Select statement together and send it to the reports Datasource.
names "VKBelegeumsaetze".

Thx for helping

stephan
I do this by setting the SqlCommand property of the StiSqlSource. I get the DataSource from the report and cast it to an StiSqlSource first. Fairly easy. I can knock up an example if you need me to.

Setting SQL Statement of Datasource

Posted: Mon Jan 21, 2008 10:22 am
by Stephan1
Ah,

i found it allready, i was too fast posting.

i just using.

Dim tableSource As Stimulsoft.Report.Dictionary.StiSqlSource = stireport1.DataSources("WaWi_VKBelegeumsaetze")

tableSource.SqlCommand = "SELECT * FROM WaWi_VKBelegeumsaetze WHERE artikelnummer like '%19%'"
stireport1.Compile()

thx

Setting SQL Statement of Datasource

Posted: Mon Jan 21, 2008 10:31 am
by mace242
Stephan1 wrote:Ah,

i found it allready, i was too fast posting.

thx
That's what I do too. All the time. :biggrin: