Page 3 of 4

set datasource

Posted: Mon Jun 11, 2012 5:50 am
by maryam
hello, I use your suggesstion "use several data table and set to the a data set then regdata(dataset) in the code", but I have a problem that don't show me the report with some table when I use a table, this suggesstion is useful, but for 2 or up this is not useful.would u help me?

set datasource

Posted: Tue Jun 12, 2012 1:52 am
by Alex K.
Hello,
the problem is not running in the designer but running in the csharp application
I append the code
This issue occurs due to because deleted and then created relations have new names.
Please try to use the following code:

Code: Select all

report.Dictionary.Databases.Clear();
//report.Dictionary.DataSources.Clear();
report.RegData("Doku", ds);
//report.Dictionary.Synchronize();
report.Show();

Thank you.

Re: set datasource

Posted: Wed Jul 18, 2012 12:01 pm
by maryam
I use ypur suggestion but don't show any thing in report, my code is here and i attached my report, can you say me, where is my problem,

Code: Select all

 DataSet ds = new DataSet();
                ds.Tables.Add(dtreport);
                ds.Tables.Add(dtItm);
                ds.Tables.Add(dtItmType);
                report.Dictionary.Clear();
                report.DataSources.Clear();
                report.RegData("PoolItem", ds);
                report.Compile();
                    if (dtGridItm.Rows.Count != 0)
                    {
                        report.Show();
                    }
thanks for your attention.

Re: set datasource

Posted: Thu Jul 19, 2012 6:38 am
by HighAley
Hello.

Please, check if TableName property of adding Table correspond ones in the report.
Try to call report.Design() and check it in the Designer.

Thank you.

Re: set datasource

Posted: Tue Apr 16, 2013 5:37 am
by amitkaushik
Yes I also hav issue here, I have multiple datasource on mrt template, and Parameters like;

report1.CompiledReport.DataSources["DS1"].Parameters["@ID"].ParameterValue = id;
report.RegData("DS2", dataset1);

and I have one datasource that needed to connected with c# I want to assign datatable object to Stimulsoft DS.
will it possible...

Re: set datasource

Posted: Tue Apr 16, 2013 7:10 am
by Alex K.
Hello,

Please try to set the parameters value before compile report and after RegData method.

Thank you.

Re: set datasource

Posted: Tue Apr 16, 2013 7:11 am
by HighAley
Hello.

Please, read next article in our Knowledge base. http://stimulsoft.helpserve.com/index.p ... ticleid=69

Thank you.

Re: set datasource

Posted: Tue Apr 16, 2013 7:26 am
by amitkaushik
Can I add c# dataset or datatable in place of querry, here...

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


it is fine but I want to add my datatable (with values) to datasource, its run but no data found on report.

Re: set datasource

Posted: Tue Apr 16, 2013 9:27 am
by Alex K.
Hello,

You can use the following code:
New connection string:
Code:
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new Stimulsoft.Report.Dictionary.StiSqlDatabase("Connection", newConnectionString));

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

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

Re: set datasource

Posted: Thu May 02, 2013 4:41 am
by amitkaushik
Thankyou its good.