Page 1 of 1

Crete report with code vb.net

Posted: Fri Feb 08, 2019 11:04 am
by jserret
Hello,


I need to create the structure attached to this post with code in vb.net

Is possible?


Could you send me an example of how to add new DataSources containing sql using code?

Thanks.

Re: Crete report with code vb.net

Posted: Mon Feb 11, 2019 9:09 am
by Lech Kulikowski
Hello,

You can find sample code in the following topic:
viewtopic.php?f=13&t=4873&p=152401

Thank you.

Re: Crete report with code vb.net

Posted: Tue Feb 12, 2019 9:15 am
by jserret
Hello,

Thank you very much, but I have another problem.

I have made the thread code but Data does not appear, I believe that the Datasource and Database are incorrectly connected, I attach capture where it seems that it is not well linked.

Re: Crete report with code vb.net

Posted: Tue Feb 12, 2019 9:41 am
by Lech Kulikowski
Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.

Re: Crete report with code vb.net

Posted: Tue Feb 12, 2019 10:12 am
by jserret
Lech Kulikowski wrote: Tue Feb 12, 2019 9:41 am Hello,

Please send us a sample project which reproduces the issue for analysis.

Thank you.
I use this code.

report.Dictionary.Databases.Clear()

Dim newConnectionString As String = "DEMO"

report.Dictionary.Databases.Add(New Stimulsoft.Report.Dictionary.StiOracleDatabase("directOracle", "directOracle", newConnectionString))
Dim sql As String = "select * from hola"

Dim DS1 As StiSqlSource = New StiSqlSource("directOracle", "ETACIV", "ETACIV", sql, True, False)

DS1.Columns.Add("ETCNOM", "ETCNOM", System.Type.GetType("System.String"))

report.Dictionary.DataSources.Add(DS1)


This is the resulting MRT. I have changed the sql and the Data Source connector for confidentiality

Re: Crete report with code vb.net

Posted: Tue Feb 12, 2019 12:36 pm
by Lech Kulikowski
Hello,

Your data source is StiSqlSource but should be StiOracleSource. Please check your code.

Thank you.