Page 1 of 1

Have our own DataSoure Provider for report designer.

Posted: Fri Nov 18, 2011 6:03 am
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

Have our own DataSoure Provider for report designer.

Posted: Mon Nov 21, 2011 1:53 am
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.

Have our own DataSoure Provider for report designer.

Posted: Mon Nov 21, 2011 6:11 am
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

Have our own DataSoure Provider for report designer.

Posted: Tue Nov 22, 2011 8:11 am
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.

Have our own DataSoure Provider for report designer.

Posted: Wed Nov 23, 2011 5:48 am
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

Have our own DataSoure Provider for report designer.

Posted: Mon Nov 28, 2011 3:39 am
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.