Page 1 of 1

Invalid expression term in runtime report

Posted: Wed Oct 31, 2012 5:02 pm
by borges
Good afternoon!

I have the 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 the code (dataText.Text = "{TABLE.47AUX1}") it returns 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...

Re: Invalid expression term in runtime report

Posted: Thu Nov 01, 2012 5:56 am
by HighAley
Hello.

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

Thank you.