Setting SQL Statement of Datasource

Stimulsoft Reports.NET discussion
Post Reply
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Setting SQL Statement of Datasource

Post 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
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Setting SQL Statement of Datasource

Post 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.
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Setting SQL Statement of Datasource

Post 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
mace242
Posts: 43
Joined: Tue Aug 21, 2007 9:24 am

Setting SQL Statement of Datasource

Post 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:

Post Reply