Error RegData in Web & Windows app

Stimulsoft Reports.NET discussion
Post Reply
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Error RegData in Web & Windows app

Post 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.

Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Error RegData in Web & Windows app

Post by Andrew »

Please, send us a file of a report. We will inform you what is the problem.

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Error RegData in Web & Windows app

Post 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.
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Error RegData in Web & Windows app

Post 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.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Error RegData in Web & Windows app

Post 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.
atryass
Posts: 33
Joined: Mon Sep 15, 2008 7:42 am
Location: Iran

Error RegData in Web & Windows app

Post by atryass »

Thanx a lot
my problem is solved.
Thank you so much.:grinder:

Post Reply