Invalid expression term at report in runtime
Posted: Wed Oct 31, 2012 4:41 pm
I have this following code:
When I use the commented code (dataText.Text = "{TABLE.DESCRICAO}") it works perfect. But when I use (dataText.Text = "{TABLE.47AUX1}") it return the following error: Invalid expression term...
Can someone tell me what is wrong and how to solve this problem?
Thank you for the help and attention of all...
Code: Select all
DataTable dt = new DataTable();
dt.Columns.Add("DESCRICAO", typeof(string));
dt.Columns.Add("47AUX1", typeof(string));
dt.Rows.Add("TEST1", "AUXILIARY1");
dt.Rows.Add("TEST2", "AUXILIARY2");
dt.TableName = "TABLE";
StiReport report = new StiReport();
StiPage page = report.Pages[0];
//Create Databand
StiDataBand dataBand = new StiDataBand();
dataBand.DataSourceName = "TABLE";
dataBand.Height = 0.5;
dataBand.Name = "DataBand";
page.Components.Add(dataBand);
//Create text
StiText dataText = new StiText(new RectangleD(0, 0, 5, 0.5));
//dataText.Text = "{TABLE.DESCRICAO}";
dataText.Text = "{TABLE.47AUX1}";
dataText.Name = "DataText";
dataBand.Components.Add(dataText);
//Add data to datastore
report.RegData(dt);
//Fill dictionary
report.Dictionary.Synchronize();
report.Show();
Can someone tell me what is wrong and how to solve this problem?
Thank you for the help and attention of all...