protected Table BuildStatisticsTable( IEnumerable items, string itemColumnName, string numberColumnName, StatisticsBuilderCallback buildFn, out string totalString, object args) { int total = 0; Table table = new Table(); table.CssClass = "statsTableStyle"; TableRow row = new TableRow(); row.CssClass = "statsTableHeaderRowStyle"; row.Cells.Add(new TableCell()); row.Cells.Add(new TableCell()); row.Cells[0].CssClass = "statsTableHeaderColumnStyle"; row.Cells[1].CssClass = "statsTableHeaderNumColumnStyle"; row.Cells[0].Text = itemColumnName; row.Cells[1].Text = numberColumnName; table.Rows.Add(row); foreach (StatisticsItem item in items) { row = new TableRow(); row.CssClass = "statsTableRowStyle"; row.Cells.Add(new TableCell()); row.Cells.Add(new TableCell()); row.Cells[0].CssClass = "statsTableColumnStyle"; row.Cells[1].CssClass = "statsTableNumColumnStyle"; buildFn(row, item, args); if (row.Cells[1].Text.Length > 0) { total += item.count; table.Rows.Add(row); } } TableRow totalRow = new TableRow(); totalRow.CssClass = "statsTableFooterRowStyle"; totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells[0].CssClass = "statsTableFooterColumnStyle"; totalRow.Cells[1].CssClass = "statsTableFooterNumColumnStyle"; totalRow.Cells[0].Text = resmgr.GetString("text_activity_total"); totalString = total.ToString(); totalRow.Cells[1].Text = totalString; table.Rows.Add(totalRow); return(table); }
protected Table BuildStatisticsTable( IEnumerable items, string itemColumnName, string numberColumnName, StatisticsBuilderCallback buildFn, object args) { string total = string.Empty; return(BuildStatisticsTable(items, itemColumnName, numberColumnName, buildFn, out total, args)); }
protected Table BuildStatisticsTable( IEnumerable items, string itemColumnName, string numberColumnName, StatisticsBuilderCallback buildFn, out string totalString, object args) { int total = 0; Table table = new Table(); table.CssClass = "statsTableStyle"; TableRow row = new TableRow(); row.CssClass = "statsTableHeaderRowStyle"; row.Cells.Add(new TableCell()); row.Cells.Add(new TableCell()); row.Cells[0].CssClass = "statsTableHeaderColumnStyle"; row.Cells[1].CssClass = "statsTableHeaderNumColumnStyle"; row.Cells[0].Text = itemColumnName; row.Cells[1].Text = numberColumnName; table.Rows.Add(row); foreach (StatisticsItem item in items) { row = new TableRow(); row.CssClass = "statsTableRowStyle"; row.Cells.Add(new TableCell()); row.Cells.Add(new TableCell()); row.Cells[0].CssClass = "statsTableColumnStyle"; row.Cells[1].CssClass = "statsTableNumColumnStyle"; buildFn( row, item, args ); if (row.Cells[1].Text.Length > 0) { total += item.count; table.Rows.Add(row); } } TableRow totalRow = new TableRow(); totalRow.CssClass="statsTableFooterRowStyle"; totalRow.Cells.Add(new TableCell()); totalRow.Cells.Add(new TableCell()); totalRow.Cells[0].CssClass = "statsTableFooterColumnStyle"; totalRow.Cells[1].CssClass = "statsTableFooterNumColumnStyle"; totalRow.Cells[0].Text = resmgr.GetString("text_activity_total"); totalString = total.ToString(); totalRow.Cells[1].Text = totalString; table.Rows.Add(totalRow); return table; }
protected Table BuildStatisticsTable( IEnumerable items, string itemColumnName, string numberColumnName, StatisticsBuilderCallback buildFn, object args) { string total = string.Empty; return BuildStatisticsTable(items,itemColumnName,numberColumnName,buildFn,out total,args); }