Page 1 of 1

Error RegData in Web & Windows app

Posted: Sat Jan 03, 2009 8:13 am
by atryass
Hi
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:
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
'SqlReport' is my connection name in dictionary when I create a data source in designer !

if i add rpt.render() & rpt.compile() it has error again.
plz help me.
i have this problem in web app too.


Error RegData in Web & Windows app

Posted: Sun Jan 04, 2009 6:13 am
by Andrew
Please, send us a file of a report. We will inform you what is the problem.

Thank you.

Error RegData in Web & Windows app

Posted: Sun Jan 04, 2009 10:18 am
by Vital
Hello,

I have checked report which you have sent to us. It do not contain any "SqlReport" identifiers. Have you sent a correct report?

Thank you.

Error RegData in Web & Windows app

Posted: Mon Jan 05, 2009 1:32 am
by atryass
ok,sorry!
but this report has a similar error.
and every report that I create has same error.
if i don't use this code:

Code: Select all

rpt.Dictionary.DataSources.Clear();
there is no error but data in report is not from data set!!!
if I use that code I have this Error

Code: Select all

c:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(103,23) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(108,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(118,23) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(123,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(133,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(138,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(163,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(168,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(183,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(193,40) : error CS0103: The name 'RoleReport' does not exist in the current contextc:\Documents and Settings\afatehi\Local Settings\Temp\q54n_azc.0.cs(198,40) : error CS0103: The name 'RoleReport' does not exist in the current context
I email this report again for u!
tanx a lot.

Error RegData in Web & Windows app

Posted: Mon Jan 05, 2009 6:49 am
by Edward
Hi Atryass,

First of all thank you for the files.

Please make sure that you renamed a table in the DataSet according with the name of the SqlSource in the report. Also there is a Calculated Columns in that SQL Server based DataSource.

Please create another report template (mrt file) for using with DataSet and use it instead of deletion of datasources and registering of the DataSet in the same report. But if all Calculated columns are presented as regular columns in the DataSet and you renamed the table as follows:

DataSet.Tables[0].TableName = "RoleReport";

then using RegData with a DataSet is possible in the old template as well.

Thank you.

Error RegData in Web & Windows app

Posted: Sun Jan 11, 2009 12:53 am
by atryass
Thanx a lot
my problem is solved.
Thank you so much.:grinder: