I create a .mrt file with a SqlConnection in designer.
and load it in code,I want to use a data set as dataSource report but it has Error.
my code is :
StiReport rpt = new StiReport();
rpt.Load(@"..\..\myreport.mrt");
rpt.Dictionary.DataSources.Clear();
rpt.Dictionary.Databases.Clear();
rpt.Dictionary.DataStore.Clear();
rpt.RegData("SqlReport",dataSet1);
rpt.Dictionary.Synchronize();
rpt.Show();
that dataset1 is fill!!
and my Error is:
'SqlReport' is my connection name in dictionary when I create a data source in designer !c:\Documents and Settings\afatehi\Local Settings\Temp\yz-mdukw.0.cs(34,40) : error CS0103: The name 'SqlReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\yz-mdukw.0.cs(39,40) : error CS0103: The name 'SqlReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\yz-mdukw.0.cs(44,40) : error CS0103: The name 'SqlReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\yz-mdukw.0.cs(49,40) : error CS0103: The name 'SqlReport' does not exist in the current context
if i add rpt.render() & rpt.compile() it has error again.
plz help me.
i have this problem in web app too.