Can assign to XtraReport dynamic data to calculate the total ?


Author
Message
Dong Trien Lam
Dong Trien Lam
StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)StrataFrame Novice (105 reputation)
Group: Anonymous / Guest
Posts: 57, Visits: 251
Suppose I have the following code:

private void button1_Click(object sender, EventArgs e)
        {
            DataTable dt = CreateTableBill(10);
            rptReport rpt = new rptReport();
            rpt.DataSource = dt;
            rpt.ShowPreview();
        }

        private static DataTable CreateTable(int RowCount)
        {
            DataTable tbl = new DataTable();
            tbl.Columns.Add("ID", typeof(int));
            tbl.Columns.Add("Product", typeof(string));            
            tbl.Columns.Add("Number", typeof(int));
            tbl.Columns.Add("UnitPrice", typeof(int));            
            for (int i = 0; i < RowCount; i++)
                tbl.Rows.Add(new object[] { i + 1, String.Format("Product {0}", i), 3 - i, 2.5 * 100 });
            return tbl;
        }


to turn on their schools dt can be assigned to schools dt
XrTableCell1 = [Product];
XrTableCell2 = [Number];
XrTableCell3 = [UnitPrice];
XrTableCell4 = [Number] * [UnitPrice];
XrTableCell5 += Sum ([Number] * [UnitPrice]);

when you open the report in design mode, I want to calculate the sum of XrTableCell5, I have to XrTableCell5 under DataBindings-> Text: assignment: Sum ([Number] * [UnitPrice]), but the result None, why not calculate the total be ? you see attach file http://www.mediafire.com/view/s1fs5fhxnz4z1f2/Sumbill.jpg
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search