Hi,
Now, the dataset is not crossed anymore and I can drag-drop the fields to my report. But the report preview does not show any data, and when I try to use a StiWebViewer to show the saved report, it says:
"Format of the initialization string does not conform to specification starting at index 0."
and shows the following line as the error line:
StiWebViewer1.Report = r;
here is the code I am using to invoke the designer
dset = dbm.Query("SELECT Alias, Fullname FROM users");
dset.Tables[0].TableName = "users";
StiReport r = new StiReport();
string connString = "SELECT Alias, Fullname FROM users";
StiSqlDatabase database = new StiSqlDatabase(dset.DataSetName, connString);
r.Dictionary.Databases.Clear();
r.Dictionary.Databases.Add(database);
r.RegData(dset.DataSetName, dset);
r.Dictionary.Synchronize();
StiWebDesigner1.Design(r);
and to show the report:
dset = dbm.Query("SELECT Alias, Fullname FROM users");
dset.Tables[0].Rows.Add("Ali", "Ali");
dset.Tables[0].TableName = "users";
StiReport r = new StiReport();
r.Load("c:\\Users\\bakhtiari\\Desktop\\1.mrt");
string connString = "SELECT Alias, Fullname FROM users";
StiSqlDatabase database = new StiSqlDatabase(dset.DataSetName, connString);
r.Dictionary.Databases.Clear();
r.Dictionary.Databases.Add(database);
r.RegData(dset.DataSetName, dset);
r.Dictionary.Synchronize();
StiWebViewer1.Report = r;
r.Render(true);
I have added that "dset.Tables[0].TableName = "users";" lines to see if it may solve the problem, but no change.
Besides, are you sure it is a good idea to use a SELECT command here? I am going to use it as the report engine for an ERP, and the main application populates a dataset and sends it to me to create reports. The dataset I am given can be quite complex and I don't know how i should create a SELECT command to represent all the relations in it!