Page 1 of 1

report.Render(false) ExecuteReader Error

Posted: Sat Feb 28, 2009 1:19 am
by alharbi
hi,

I am having this error:
Message:ExecuteReader: CommandText property has not been initialized.
Type:System.InvalidOperationException

at this point:
report.Render(false)

sample code

DataTable dtTemp = new DataTable("lostpassword");
.
.
.
StiReport report = StiReport.GetReportFromAssembly("E:\\Projects\\HRS\\HRS\\lostpassword.dll");
report.RegData(dtTemp);
report.Render(false);

report.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, "E:\\Projects\\HRS\\HRS\\" + sUserID + ".pdf");

thank you .

report.Render(false) ExecuteReader Error

Posted: Sat Feb 28, 2009 4:07 am
by alharbi
i am try to clear connection string but the problem still .


report.Dictionary.Databases.Clear();

report.Dictionary.Databases.Add(new StiSqlDatabase("HRS", strConString));

report.Render(false) ExecuteReader Error

Posted: Sat Feb 28, 2009 12:37 pm
by Jan
Hello,

You are use Data from Sql database and from DataTable at same time?

Thank you.

report.Render(false) ExecuteReader Error

Posted: Sat Feb 28, 2009 1:40 pm
by alharbi

thank you ,

yes , but how i can useing Data from DataTable Only ?

In other words, how do I delete the link between the report file (during design) and the database?

I deleted The ConnectionString and SQL Stament Manual, but to no avail!


report.Render(false) ExecuteReader Error

Posted: Sun Mar 01, 2009 2:26 pm
by Jan
Hello,

You can use following code:

Code: Select all

report.Dictionary.Databases.Clear();
report.Dictionary.DataSources.Clear();
report.RegData(dataTable);
report.Dictionary.Synchronize();
If you need replace Sql Source by DataTable DataSource you need use same Name of Data Source.

Thank you.