Invalid expression term at report in runtime

Stimulsoft Reports.NET discussion
Post Reply
borges
Posts: 5
Joined: Wed Oct 31, 2012 4:08 pm
Location: Brazil

Invalid expression term at report in runtime

Post by borges »

I have this following code:

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();
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...
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Invalid expression term at report in runtime

Post by HighAley »

Hello.

Due to .Net Framework name convention you couldn't use fields which start from digit.

Thank you.
Post Reply