Have our own DataSoure Provider for report designer.

Stimulsoft Reports.WEB discussion
Post Reply
Chasoo
Posts: 40
Joined: Wed Oct 19, 2011 1:29 am

Have our own DataSoure Provider for report designer.

Post by Chasoo »

We are trying to use Stimulsoft report designer in our existing application. we want to use our existing Nhibernate connection in report designer and to execute report as well.So we thought of having our own provider to achieve this.is there a any way of adding our ownProvider (something like StiOledbDataBase). or is there a better solution ?

tnx

chaminda
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Have our own DataSoure Provider for report designer.

Post by Alex K. »

Hello,

You can create your own data provider (you can see the additional data providers from our site as a sample) or use DataSet and send it to the report.

Thank you.
Chasoo
Posts: 40
Joined: Wed Oct 19, 2011 1:29 am

Have our own DataSoure Provider for report designer.

Post by Chasoo »

i want to execute report with our existing Database Connection (which is use for Nhibernate).without passing the connections string cant we pass CommandObject(which has derived from idbcommand) to report. otherthan creating a StiOledbDataBase or StiSqlDataBase with a connection string.

tnx

chaminda
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Have our own DataSoure Provider for report designer.

Post by Alex K. »

Hello,

If we understood your problem correctly, you can set all connections to the database in your application, get data and then send them into a report using the RegData() or RegBussinessObject() method.

Thank you.
Chasoo
Posts: 40
Joined: Wed Oct 19, 2011 1:29 am

Have our own DataSoure Provider for report designer.

Post by Chasoo »

tnx for the reply,

what i was trying to do , without executing database commands in our application and send dataset or businessobject to report, we wanted to set command object to the stireport(which has configured with database connection and database command).and then report will execute the command which we have send to stireport and display data.

this is what i want to have in our solution.

chaminda
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Have our own DataSoure Provider for report designer.

Post by Alex K. »

Hello,

You can use the following code.
New connection string:

Code: Select all

report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));
Add DataSources:

Code: Select all

StiSqlSource DS1 = new StiSqlSource("Connection", "DS1", "DS1", "SELECT * FROM DS1", true, false);
report.Dictionary.DataSources.Add(DS1);
Add Columns:

Code: Select all

foreach (DataColumn col in dataTableDS1.Columns)
{
     DS1.Columns.Add(col.ColumnName, col.DataType);
}
Add Relations:

Code: Select all

StiDataRelation dataRelation = new StiDataRelation("MyRelation", parentDS, childDS, new string[] { "Field" }, new string[] { "Field" });
report.Dictionary.RegRelations();
report.Dictionary.Relations.Add(dataRelation);
Thank you.
Post Reply