void InitGroupHeaders(MVCxGridViewState gridViewState) { GridViewDataColumnStateCollection groupedColumns = gridViewState.GroupedColumns; for (int i = groupedColumns.Count - 1; i >= 0; i--) { { GridViewDataColumnState groupedColumn = groupedColumns[i]; GroupHeaderBand gb = new GroupHeaderBand(); gb.Height = bandHeight; XRLabel l = new XRLabel { Text = groupedColumn.FieldName + ": [" + groupedColumn.FieldName + "]", LocationF = new PointF(initialGroupOffset + i * 10, 0), BackColor = Color.Beige, SizeF = new SizeF((report.PageWidth - (report.Margins.Left + report.Margins.Right)) - (initialGroupOffset + i * subGroupOffset), bandHeight) }; gb.Controls.Add(l); gb.RepeatEveryPage = shouldRepeatGroupHeadersOnEveryPage; GroupField gf = new GroupField(groupedColumn.FieldName, groupedColumn.SortOrder == ColumnSortOrder.Ascending ? XRColumnSortOrder.Ascending : XRColumnSortOrder.Descending); gb.GroupFields.Add(gf); report.Bands.Add(gb); } } }
public void BindDataSum(DataTable da) { xrTable4.Visible = false; DataSource = da; Bands.Add(GroupHeader1); GroupField groupField = new GroupField("Số phiếu"); GroupHeader1.GroupFields.Add(groupField); xrTableCell1.DataBindings.Add("Text", DataSource, "Số phiếu"); xrTableCell2.DataBindings.Add("Text", DataSource, "Ngày", "{0:dd-MM-yyyy}"); xrTableCell3.DataBindings.Add("Text", DataSource, "Lý do"); xrTableCell4.DataBindings.Add("Text", DataSource, "Nhân viên"); XRSummary summarytotal = new XRSummary(); XRSummary summarytotal1 = new XRSummary(); summarytotal.Running = SummaryRunning.Group; summarytotal.IgnoreNullValues = true; summarytotal.FormatString = "{0:n0}"; xrTableCell20.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); xrTableCell20.Summary = summarytotal; summarytotal1.Running = SummaryRunning.Report; summarytotal1.IgnoreNullValues = true; summarytotal1.FormatString = "{0:n0}"; xrTableCell19.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); xrTableCell19.Summary = summarytotal1; xrTableCell7.DataBindings.Add("Text", DataSource, "Tài khoản nợ"); xrTableCell10.DataBindings.Add("Text", DataSource, "Tài khoản có"); xrTableCell11.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); }
public void gettieudegau(string tungay, string denngay, string makhuyenmai) { xrLabel5.Text = "BÁO CÁO ĐỐI CHIẾU CHIẾT KHẤU GẤU ĐỎ"; xrLabel1.Text = gen.GetString("select Top 1 CompanyName from Center"); xrLabel2.Text = gen.GetString("select Top 1 Address from Center"); xrLabel6.Text = "MÃ KHUYẾN MÃI - " + makhuyenmai.ToUpper(); xrLabel4.Text = "In lúc: " + String.Format("{0:HH:mm:ss}", DateTime.Now) + " ngày: " + String.Format("{0:dd-MM-yyyy}", DateTime.Now); DataTable da = new DataTable(); da = gen.GetTable("select Substring(RefNo,7,9) as 'Số phiếu',RefDate as 'Ngày lập',REPLACE(InvoiceNo,'UNI','') as 'Đơn hàng',case when FreeCode='" + makhuyenmai + "' then sotien end as 'Số tiền',case when FreeCode<>'" + makhuyenmai + "' then sotien end as 'Tiền khác', case when FreeCode<>'" + makhuyenmai + "' then FreeCode end 'Chương trình khác',tongtien as 'Tổng tiền',chietkhau as 'Chiết khấu',Case when tongtien-chietkhau<>0 then tongtien-chietkhau end as 'Chênh lệch' from (select a.InvoiceNo,FreeCode,sotien,tongtien from (select a.InvoiceNo,FreeCode,SUM(Amount) as sotien from (select * from INOutwardCheck where Amount<>0) a, (select distinct InvoiceNo from INOutwardCheck where FreeCode='" + makhuyenmai + "') b where a.InvoiceNo=b.InvoiceNo group by a.InvoiceNo,FreeCode) a,(select a.InvoiceNo,SUM(Amount) as tongtien from (select * from INOutwardCheck where Amount<>0) a, (select distinct InvoiceNo from INOutwardCheck where FreeCode='" + makhuyenmai + "') b where a.InvoiceNo=b.InvoiceNo group by a.InvoiceNo) b where a.InvoiceNo=b.InvoiceNo) a,(select RefNo,RefDate,JournalMemo,Round(TotalFreightAmount/1.1,0) as chietkhau from INOutward) b where a.InvoiceNo=b.JournalMemo order by RefNo,RefDate,[Số tiền] DESC"); DataSource = da; XRSummary summarytotal = new XRSummary(); XRSummary summarytotal1 = new XRSummary(); XRSummary summarytotal2 = new XRSummary(); XRSummary summarytotal3 = new XRSummary(); XRSummary summarytotal4 = new XRSummary(); XRSummary summarytotal5 = new XRSummary(); Bands.Add(GroupHeader1); GroupField groupField = new GroupField("Đơn hàng"); GroupHeader1.GroupFields.Add(groupField); xrTableCell10.DataBindings.Add("Text", DataSource, "Đơn hàng"); xrTableCell9.DataBindings.Add("Text", DataSource, "Ngày lập", "{0:dd/MM/yy}"); xrTableCell8.DataBindings.Add("Text", DataSource, "Số phiếu"); xrTableCell15.DataBindings.Add("Text", DataSource, "Chiết khấu", "{0:n0}"); xrTableCell18.DataBindings.Add("Text", DataSource, "Chênh lệch", "{0:n0}"); summarytotal.Running = SummaryRunning.Group; summarytotal.IgnoreNullValues = true; summarytotal.FormatString = "{0:n0}"; xrTableCell11.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); xrTableCell11.Summary = summarytotal; summarytotal1.Running = SummaryRunning.Group; summarytotal1.IgnoreNullValues = true; summarytotal1.FormatString = "{0:n0}"; xrTableCell12.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}"); xrTableCell12.Summary = summarytotal1; summarytotal4.Running = SummaryRunning.Report; summarytotal4.IgnoreNullValues = true; summarytotal4.FormatString = "{0:n0}"; xrTableCell20.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); xrTableCell20.Summary = summarytotal4; summarytotal5.Running = SummaryRunning.Report; summarytotal5.IgnoreNullValues = true; summarytotal5.FormatString = "{0:n0}"; xrTableCell21.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}"); xrTableCell21.Summary = summarytotal5; xrTableCell22.DataBindings.Add("Text", DataSource, "Số tiền", "{0:n0}"); xrTableCell24.DataBindings.Add("Text", DataSource, "Tiền khác", "{0:n0}"); xrTableCell26.DataBindings.Add("Text", DataSource, "Chương trình khác"); }
private void ResolveColumns(List <object[]> row) { foreach (object[] cell in row) { GroupField groupField = cell[2] as GroupField; if (groupField != null && groupField.Columns.Count > 0) { List <object[]> subrow = new List <object[]>(); foreach (GridColumn column in groupField.Columns) { subrow.Add(new object[] { 1, 1, column, groupField }); } ResolveColumns(subrow); } else { Columns.Add(cell[2] as GridColumn); } } }
public void Sort(string fieldName) { // Disable sorting. Detail.SortFields.Clear(); // Create a new sorting criterion. GroupField grField = new GroupField { FieldName = fieldName }; if (prevSortOrder == XRColumnSortOrder.Ascending) { prevSortOrder = XRColumnSortOrder.Descending; } else { prevSortOrder = XRColumnSortOrder.Ascending; } grField.SortOrder = prevSortOrder; // Enable sorting. Detail.SortFields.Add(grField); // Re-create the report document. CreateDocument(true); }
public void _bindData() { // Create a label. xrTableCell1.DataBindings.Add("Text", null, "id"); xrLabel4.DataBindings.Add("Text", null, "hoten"); GroupField g = new GroupField(); g.FieldName = "hoten"; g.SortOrder = XRColumnSortOrder.Ascending; GroupHeader1.Controls.Add(xrLabel4); GroupHeader1.GroupFields.Add(g); xrTableCell3.DataBindings.Add("Text", null, "sodienthoai"); xrLabel12.DataBindings.Add("Text", null, "sodienthoai"); //// Add the label to the report's Detail band. //Detail.Controls.Add(label); //// Set its location and size. //label.Location = bounds.Location; //label.Size = bounds.Size; //// Bind it to the bindingMember data field. //// When the dataSource parameter is null, the report's data source is used. //label.DataBindings.Add("Text", null, bindingMember); }
private void bPSUPX_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { Server2Client sc = new Server2Client(); ProductDetails pd = new ProductDetails(); sc = pd.ProductListBySupplierExtended(); rptProductBySup rpt = new rptProductBySup() { DataSource = sc.dataTable }; GroupField grp = new GroupField("SupplierName"); rpt.groupHeader.GroupFields.Add(grp); rpt.lbSUP.DataBindings.Add("Text", null, "SupplierName"); rpt.lbPNM.DataBindings.Add("Text", null, "ProductName"); rpt.lbBVL.DataBindings.Add("Text", null, "BuyingValue", "{0:C2}"); rpt.lbSVL.DataBindings.Add("Text", null, "SellingValue", "{0:C2}"); rpt.lbQTY.DataBindings.Add("Text", null, "Quantity"); rpt.lbBCD.DataBindings.Add("Text", null, "BarCode"); dv.PrintingSystem = rpt.PrintingSystem; rpt.CreateDocument(true); }
private void barButtonItemLocaleStatus_ItemClick(object sender, ItemClickEventArgs e) { DataTable dtLocaleReport = new DataTable(); XtraReportLocaleStatus localeStatusReport = new XtraReportLocaleStatus(); using (var adapt = new SqlDataAdapter("GET_LOCALE_REPORT", Utilities.con)) { adapt.SelectCommand.CommandType = CommandType.StoredProcedure; adapt.Fill(dtLocaleReport); localeStatusReport.DataSource = dtLocaleReport; } if (dtLocaleReport.Rows.Count == 0) { MessageBox.Show("No Status found"); } else { GroupField gfFlag = new GroupField(dtLocaleReport.Columns["flag"].ToString()); localeStatusReport.GroupHeader.GroupFields.Add(gfFlag); localeStatusReport.xrLabelGroup.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["flag"].ToString()); localeStatusReport.xrLabelMonth.Text = "As of " + DateTime.Now.ToString("MMMM").ToUpper(); localeStatusReport.xrLabelUser.Text = "Generated by: " + frmLogin.Username; localeStatusReport.xrTableCellStatus.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["Status"].ToString()); localeStatusReport.xrTableCellTotal.DataBindings.Add("Text", dtLocaleReport, dtLocaleReport.Columns["Total"].ToString()); localeStatusReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(localeStatusReport); printTool.ShowPreview(); } }
public List<int> GetGroupPriceList(GroupField field, int numberOfGroup) { var result = new List<int>(); if (numberOfGroup < 0) numberOfGroup = 1; var groupSize = CalculateGroupSize(_products.Count, numberOfGroup); var items = GetGroupByField(field); for (int i = 0; i < groupSize; i++) { int total; if (items.Count >= numberOfGroup) { total = items.Take(numberOfGroup).Sum(); result.Add(total); } else { total = items.Sum(); result.Add(total); break; } items.RemoveRange(0, numberOfGroup); } return result; }
void btn_Click(object sender, EventArgs e) { GroupField en = new GroupField(this.RefOID); en.Lab = this.Pub1.GetTBByID("TB_Lab_" + en.OID).Text; en.Update(); Btn btn = sender as Btn; switch (btn.ID) { case "Btn_SaveAndClose": this.WinClose(); break; case "Btn_NewField": this.Session["GroupField"] = this.RefOID; this.Response.Redirect("Do.aspx?DoType=AddF&MyPK=" + this.RefNo + "&GroupField=" + this.RefOID, true); break; case "Btn_CopyField": this.Response.Redirect("CopyFieldFromNode.aspx?FK_Node=" + this.RefNo + "&GroupField=" + this.RefOID, true); break; default: this.Response.Redirect("GroupField.aspx?RefNo=" + this.RefNo + "&RefOID=" + this.RefOID, true); break; } }
private void barButtonItemAccept_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { BindAttendanceToReport(); if (dtAttendance.Rows.Count == 0) { Utilities.ErrorMessage("Gathering does not exists..."); } else { SetHeaders(); GroupField gfBatch = new GroupField(dtAttendance.Columns["batch_time"].ToString()); GroupField gfInterlocale = new GroupField(dtAttendance.Columns["Interlocale_Status"].ToString()); attendanceReport.GroupHeader.GroupFields.Add(gfInterlocale); attendanceReport.GroupHeader.GroupFields.Add(gfBatch); attendanceReport.xrLabelInterlocale.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["Interlocale_Status"].ToString()); attendanceReport.xrLabelBatch.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["batch_time_lbl"].ToString()); attendanceReport.xrTableCellChurchID.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["Church_Id"].ToString()); attendanceReport.xrTableCellName.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["BrethrenName"].ToString()); attendanceReport.xrTableCellTimeIn.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["time_in"].ToString()); attendanceReport.xrTableCellStatus.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["AttendanceStatus"].ToString()); attendanceReport.xrTableCellLocale.DataBindings.Add("Text", dtAttendance, dtAttendance.Columns["locale"].ToString()); attendanceReport.Name = gridView1.GetFocusedRowCellValue("Gathering_Type").ToString().Replace(" ", string.Empty); attendanceReport.CreateDocument(); ReportPrintTool printTool = new ReportPrintTool(attendanceReport); printTool.ShowPreviewDialog(); } }
public void BindData() { GroupField grp = new GroupField("Loai", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending); grpLoai.GroupFields.Add(grp); crGrpLoai.DataBindings.Add(new XRBinding("Text", DataSource, "Loai")); crNgayBan.DataBindings.Add(new XRBinding("Text", DataSource, "Ngaylap")); crTenKH.DataBindings.Add(new XRBinding("Text", DataSource, "Tenkh")); crDiaChi.DataBindings.Add(new XRBinding("Text", DataSource, "Diachi")); crDienthoai.DataBindings.Add(new XRBinding("Text", DataSource, "Dienthoai")); crThuNgan.DataBindings.Add(new XRBinding("Text", DataSource, "Thungan")); crGhichu.DataBindings.Add(new XRBinding("Text", DataSource, "Ghichu")); crSTT.DataBindings.Add(new XRBinding("Text", DataSource, "STT")); crTenSP.DataBindings.Add(new XRBinding("Text", DataSource, "Diengiai")); crSL.DataBindings.Add(new XRBinding("Text", DataSource, "Soluong", "{0:n0}")); crDonGia.DataBindings.Add(new XRBinding("Text", DataSource, "Dongia", "{0:n0}")); crThanhtien.DataBindings.Add(new XRBinding("Text", DataSource, "Nguyente", "{0:n0}")); crTienhang.DataBindings.Add(new XRBinding("Text", DataSource, "Tienhang", "{0:n0}")); crChietKhau.DataBindings.Add(new XRBinding("Text", DataSource, "TongTTCk", "{0:n0}")); crTongCong.DataBindings.Add(new XRBinding("Text", DataSource, "Thanhtoan", "{0:N0}")); crDiemtichluy.DataBindings.Add(new XRBinding("Text", DataSource, "DiemTichLuy", "{0:N0}")); }
public XtraStatementOfAccountReport() { InitializeComponent(); GroupField gf = new GroupField("用料", XRColumnSortOrder.Ascending); ((GroupHeaderBand)(this.DetailReportSummary.FindControl("GroupHeader2", true))).GroupFields.Add(gf); }
public rp_masa_grubuna_gore_satislar(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get(" SELECT " + " mk.masa_kategori, " + " tutar = ISNULL((SELECT SUM(fh.miktar) FROM finans_hareket fh INNER JOIN adisyon a ON a.adisyon_id = fh.referans_id INNER JOIN masalar m ON m.masa_id = a.masa_id AND m.masa_kategori_id = mk.masa_kategori_id WHERE fh.silindi = 0 AND fh.hareket_tipi_parametre_id IN (25, 26, 27) AND fh.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0) " + " FROM masalar_kategori mk " + " WHERE mk.silindi = 0 " + " AND 0 != ISNULL((SELECT SUM(fh.miktar) FROM finans_hareket fh INNER JOIN adisyon a ON a.adisyon_id = fh.referans_id INNER JOIN masalar m ON m.masa_id = a.masa_id AND m.masa_kategori_id = mk.masa_kategori_id WHERE fh.silindi = 0 AND fh.hareket_tipi_parametre_id IN (25, 26, 27) AND fh.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')), 0)"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "masa_kategori", ""); tc_masa_grubu.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding1); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
private void InsertGroupBand(GridColumn gridColumn, int i) { GroupHeaderBand gb = new GroupHeaderBand(); gb.Height = 25; gb.RepeatEveryPage = true; XRLabel l = new XRLabel(); l.DataBindings.Add("Text", this.DataSource, gridColumn.Caption); l.Size = new Size(300, 25); l.Location = new Point(0 + i * 20, 0); l.BackColor = Color.Beige; gb.Controls.Add(l); GroupField gf; if (gridColumn.SortOrder == ColumnSortOrder.Ascending) { gf = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Ascending); } else { gf = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Descending); } gb.GroupFields.Add(gf); this.Bands.Add(gb); }
public rp_personel_iptal(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT ad_soyad = k.ad + ' ' + k.soyad, u.urun_adi, miktar = SUM(ak.miktar), tutar = SUM(ak.miktar * u.fiyat) FROM kullanicilar k LEFT OUTER JOIN adisyon_kalem ak ON ak.silindi = 1 AND ak.durum_parametre_id != 51 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "') INNER JOIN urunler u ON u.urun_id = ak.urun_id " + " WHERE k.silindi = 0 GROUP by k.ad, k.soyad, u.urun_adi"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); lbl_personel.DataBindings.Add(binding0); XRBinding binding2 = new XRBinding("Text", this.DataSource, "urun_adi", ""); tc_urun.DataBindings.Add(binding2); XRBinding binding3 = new XRBinding("Text", this.DataSource, "miktar", "{0:n2}"); tc_miktar.DataBindings.Add(binding3); XRBinding binding4 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_tutar.DataBindings.Add(binding4); GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); GroupField groupField = new GroupField("ad_soyad"); GroupHeader1.GroupFields.Add(groupField); }
/// <summary> /// 设置主从表的数据源 /// </summary> /// <param name="reportData"></param> public void SetReportDataSource(DataSet reportData) { //因涉及到修改DataSet的内部属性,建议创建副本进行操作。 DataSet ds = reportData.Copy();//创建副本 //重要!!!给组(GroupHeader)绑定主键字段 //本报表是按业务单号分组 GroupField gf = new GroupField("SONO", XRColumnSortOrder.Ascending); GroupHeader1.GroupFields.Add(gf); //给数据集建立主外键关系 DataColumn parentColumn = ds.Tables["tb_SO"].Columns["SONO"]; DataColumn childColumn = ds.Tables["tb_SOs"].Columns["SONO"]; DataRelation R1 = new DataRelation("R1", parentColumn, childColumn); ds.Relations.Add(R1); //绑定主表的数据源 this.DataMember = "tb_SO"; this.DataSource = ds; //绑定明细表的数据源 this.DetailReport.DataMember = "R1"; this.DetailReport.DataSource = ds; //自动绑定明细表XRLabel的数据源 this.BindingFields(ds, this.Detail1.Controls); xrLabel15.DataBindings.Add("Text", ds, "R1.Amount"); //绑定小计(当前单据的总金额) xrLabel23.DataBindings.Add("Text", ds, "R1.Amount"); //绑定总计(所有单据的总金额) }
private void GridBoundAdd(FineUIPro.Grid grid, DataRow[] rows, DataTable table, GroupField gf) { foreach (DataRow row in rows) { DataRow[] drs = table.Select("SJCODE='" + row["CODE"].ToString() + "'"); if (drs.Length > 0) { GroupField gf1 = new GroupField(); gf1.HeaderText = row["NAME"].ToString(); gf1.TextAlign = FineUIPro.TextAlign.Center; GridBoundAdd(grid, drs, table, gf1); gf.Columns.Add(gf1); } else { GroupField gf2 = new GroupField(); gf2.HeaderText = row["NAME"].ToString(); gf2.TextAlign = FineUIPro.TextAlign.Center; FineUIPro.BoundField bfjs = new FineUIPro.BoundField(); bfjs.DataField = row["CODE"].ToString() + "_JS"; bfjs.HeaderText = "入库数量"; bfjs.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfjs); FineUIPro.BoundField bfje = new FineUIPro.BoundField(); bfje.DataField = row["CODE"].ToString() + "_JE"; bfje.HeaderText = "入库金额"; bfje.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfje); FineUIPro.BoundField bfxs = new FineUIPro.BoundField(); bfxs.DataField = row["CODE"].ToString() + "_XS"; bfxs.HeaderText = "出库数量"; bfxs.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfxs); FineUIPro.BoundField bfxe = new FineUIPro.BoundField(); bfxe.DataField = row["CODE"].ToString() + "_XE"; bfxe.HeaderText = "出库金额"; bfxe.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfxe); FineUIPro.BoundField bfcs = new FineUIPro.BoundField(); bfcs.DataField = row["CODE"].ToString() + "_CS"; bfcs.HeaderText = "库存数量"; bfcs.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfcs); FineUIPro.BoundField bfce = new FineUIPro.BoundField(); bfce.DataField = row["CODE"].ToString() + "_CE"; bfce.HeaderText = "库存数量"; bfce.TextAlign = FineUIPro.TextAlign.Right; gf2.Columns.Add(bfce); gf.Columns.Add(gf2); dtSource.Columns.Add(row["CODE"].ToString() + "_JS", Type.GetType("System.Decimal")); dtSource.Columns.Add(row["CODE"].ToString() + "_JE", Type.GetType("System.Decimal")); dtSource.Columns.Add(row["CODE"].ToString() + "_XS", Type.GetType("System.Decimal")); dtSource.Columns.Add(row["CODE"].ToString() + "_XE", Type.GetType("System.Decimal")); dtSource.Columns.Add(row["CODE"].ToString() + "_CS", Type.GetType("System.Decimal")); dtSource.Columns.Add(row["CODE"].ToString() + "_CE", Type.GetType("System.Decimal")); } } }
private void InsertGroupBand(GridColumn gridColumn, int i) { GroupHeaderBand ghBand = new GroupHeaderBand(); ghBand.Height = 25; ghBand.RepeatEveryPage = true; XRLabel lbl = new XRLabel(); lbl.ExpressionBindings.Add(new ExpressionBinding("Text", gridColumn.Caption)); lbl.Size = new Size(300, 25); lbl.Location = new Point(0 + i * 20, 0); lbl.BackColor = Color.Beige; ghBand.Controls.Add(lbl); GroupField gField; if (gridColumn.SortOrder == ColumnSortOrder.Ascending) { gField = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Ascending); } else { gField = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Descending); } ghBand.GroupFields.Add(gField); this.Bands.Add(ghBand); }
public rp_personel_iptal_ozet(DateTime tarih1, DateTime tarih2) { InitializeComponent(); lbl_tarih.Text = tarih1.Day + "." + tarih1.Month + "." + tarih1.Year + "-" + tarih2.Day + "." + tarih2.Month + "." + tarih2.Year; DataTable dt = SQL.get("SELECT * FROM(SELECT ad_soyad = k.ad + ' ' + k.soyad, tutar = (SELECT SUM(ak.miktar * u.fiyat) FROM adisyon_kalem ak INNER JOIN urunler u ON u.urun_id = ak.urun_id WHERE ak.silindi = 1 AND ak.durum_parametre_id != 51 AND ak.kaydeden_kullanici_id = k.kullanici_id AND ak.kayit_tarihi BETWEEN '" + tarih1.ToString("yyyy-MM-dd HH:mm:00.000") + "' AND DATEADD(DAY, 0, '" + tarih2.ToString("yyyy-MM-dd HH:mm:00.000") + "')) FROM kullanicilar k WHERE k.silindi = 0) tbl WHERE tbl.tutar != 0"); this.DataSource = dt; XRBinding binding0 = new XRBinding("Text", this.DataSource, "ad_soyad", ""); tc_urun.DataBindings.Add(binding0); XRBinding binding1 = new XRBinding("Text", this.DataSource, "tutar", "{0:n2}"); tc_tutar.DataBindings.Add(binding1); XRBinding binding6 = new XRBinding("Text", this.DataSource, "tutar", "{0:c2}"); tc_top_tutar.DataBindings.Add(binding6); XRSummary sum2 = new XRSummary(SummaryRunning.Page, SummaryFunc.Sum, "{0:c2}"); tc_top_tutar.Summary = sum2; GroupField sortField = new GroupField("tutar"); sortField.SortOrder = XRColumnSortOrder.Descending; this.Detail.SortFields.Add(sortField); }
public void BindData() { GroupField grp = new GroupField("Masp", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending); grpSP.GroupFields.Add(grp); crTensp.DataBindings.Add(new XRBinding("Text", DataSource, "Tensp")); crMasp.DataBindings.Add(new XRBinding("Text", DataSource, "Masp")); crDvt.DataBindings.Add(new XRBinding("Text", DataSource, "Dvt")); crQuycach.DataBindings.Add(new XRBinding("Text", DataSource, "Quycach")); crNgayIn.DataBindings.Add(new XRBinding("Text", DataSource, "NgayPhieu")); //crGhichuCTG.DataBindings.Add(new XRBinding("Text", DataSource, "Ghichu")); crSTT.DataBindings.Add(new XRBinding("Text", DataSource, "STT")); crNgayct.DataBindings.Add(new XRBinding("Text", DataSource, "Ngayct", "{0:dd/MM/yyyy}")); crNgayPS.DataBindings.Add(new XRBinding("Text", DataSource, "Ngayps", "{0:dd/MM/yyyy}")); crSophieuN.DataBindings.Add(new XRBinding("Text", DataSource, "SophieuN")); crSophieuX.DataBindings.Add(new XRBinding("Text", DataSource, "SophieuX")); crDiengiai.DataBindings.Add(new XRBinding("Text", DataSource, "Diengiai")); crSLN.DataBindings.Add(new XRBinding("Text", DataSource, "SLNhap", "{0:n0}")); crSLX.DataBindings.Add(new XRBinding("Text", DataSource, "SLXuat", "{0:n0}")); crCK.DataBindings.Add(new XRBinding("Text", DataSource, "Cuoiky", "{0:n0}")); }
public void BindData() { GroupField grp = new GroupField("Madt", DevExpress.XtraReports.UI.XRColumnSortOrder.Ascending); grpKH.GroupFields.Add(grp); //crNgayCT.DataBindings.Add(new XRBinding("Text", DataSource, "NgayPhieu")); xrTrangSo.DataBindings.Add(new XRBinding("Tag", DataSource, "Madt")); crSTT.DataBindings.Add(new XRBinding("Tag", DataSource, "Phieuid")); crDonvi.DataBindings.Add(new XRBinding("Text", DataSource, "Tenkh")); crDiachi.DataBindings.Add(new XRBinding("Text", DataSource, "Diachi")); crDienthoai.DataBindings.Add(new XRBinding("Text", DataSource, "Dienthoai")); crDaidien.DataBindings.Add(new XRBinding("Text", DataSource, "Daidien")); crDiengiai.DataBindings.Add(new XRBinding("Text", DataSource, "Diengiai")); crNgay.DataBindings.Add(new XRBinding("Text", DataSource, "Ngayct", "{0:dd/MM/yyyy}")); crSohoadon.DataBindings.Add(new XRBinding("Text", DataSource, "Soctgoc")); crSoPhieu.DataBindings.Add(new XRBinding("Text", DataSource, "Sophieu", "{0:n0}")); crSotienDH.DataBindings.Add(new XRBinding("Text", DataSource, "Sotien", "{0:n0}")); crNgaychono.DataBindings.Add(new XRBinding("Text", DataSource, "Nchono", "{0:n0}")); crNgayDH.DataBindings.Add(new XRBinding("Text", DataSource, "Ngaydh", "{0:dd/MM/yyyy}")); /*crSumTienDH.DataBindings.Add(new XRBinding("Text", DataSource, "Sotien", "{0:#,#}")); * crSumTienDH.Summary.Func = SummaryFunc.Sum; * crSumTienDH.Summary.FormatString = "{0:n0}"; * crSumTienDH.Summary.Running = SummaryRunning.Group; */ crSotienQH.DataBindings.Add(new XRBinding("Text", DataSource, "Dudau", "{0:n0}")); crSotienDatra.DataBindings.Add(new XRBinding("Text", DataSource, "Datra", "{0:n0}")); crSotienCantra.DataBindings.Add(new XRBinding("Text", DataSource, "Ducuoi", "{0:n0}")); }
public void BindDatakm(DataTable da) { DataSource = da; Bands.Add(GroupHeader1); GroupField groupField1 = new GroupField("Mã hàng"); GroupHeader1.GroupFields.Add(groupField1); xrTableCell1.DataBindings.Add("Text", DataSource, "Mã hàng"); xrTableCell3.DataBindings.Add("Text", DataSource, "Tên hàng"); xrTableCell4.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); XRSummary summary = new XRSummary(); summary.Running = SummaryRunning.Group; summary.IgnoreNullValues = true; summary.FormatString = "{0:n0}"; xrTableCell4.Summary = summary; xrTableCell5.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}"); XRSummary summary1 = new XRSummary(); summary1.Running = SummaryRunning.Group; summary1.IgnoreNullValues = true; summary1.FormatString = "{0:n2}"; xrTableCell5.Summary = summary1; XRSummary summarytotal = new XRSummary(); XRSummary summarytotal1 = new XRSummary(); XRSummary summarytotal3 = new XRSummary(); XRSummary summarytotal4 = new XRSummary(); XRSummary summarytotal5 = new XRSummary(); XRSummary summarytotal6 = new XRSummary(); XRSummary summarytotal7 = new XRSummary(); XRSummary summarytotal8 = new XRSummary(); summarytotal.Running = SummaryRunning.Report; summarytotal.IgnoreNullValues = true; summarytotal.FormatString = "{0:n0}"; xrTableCell22.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); xrTableCell22.Summary = summarytotal; summarytotal1.Running = SummaryRunning.Report; summarytotal1.IgnoreNullValues = true; summarytotal1.FormatString = "{0:n2}"; xrTableCell23.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}"); xrTableCell23.Summary = summarytotal1; xrTableCell16.DataBindings.Add("Text", DataSource, "Ngày lập", "{0:dd-MM-yyyy}"); xrTableCell11.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); xrTableCell12.DataBindings.Add("Text", DataSource, "Trọng lượng", "{0:n2}"); xrTableCell6.DataBindings.Add("Text", DataSource, "Phiếu"); xrTableCell10.DataBindings.Add("Text", DataSource, "Tên khách"); }
void btn_del_Click(object sender, EventArgs e) { MapAttrs attrs = new MapAttrs(); attrs.Retrieve(MapAttrAttr.GroupID, this.RefOID); foreach (MapAttr attr in attrs) { if (attr.HisEditType != EditType.Edit) { continue; } if (attr.KeyOfEn == "FID") { continue; } attr.Delete(); } MapDtls dtls = new MapDtls(); dtls.Retrieve(MapDtlAttr.GroupID, this.RefOID); foreach (MapDtl dtl in dtls) { dtl.Delete(); } GroupField gf = new GroupField(this.RefOID); gf.Delete(); this.WinClose();// ("删除成功。"); }
public ComposedGroupFieldInfo(GroupField groupField) { if (groupField == null) { throw new ArgumentNullException(nameof(groupField)); } GroupField = groupField; }
/// <summary> /// 删除之后. /// </summary> protected override void afterDelete() { GroupField gf = new GroupField(); gf.Delete(GroupFieldAttr.CtrlID, this.MyPK); base.afterDelete(); }
/// <summary> /// Constructor for Label Field Definition /// </summary> /// <param name="frm">The main form</param> /// <param name="field">The label field</param> public GroupFieldDefinition(MainForm frm, GroupField field) : base(frm) { InitializeComponent(); this.mode = FormMode.Edit; this.field = field; this.page = field.Page; LoadFormData(); }
public void BindData2(DataTable da) { GroupHeader1.Visible = true; xrTable10.Visible = true; xrTable11.Visible = true; xrTableCell18.Text = "Ghi chú"; DataSource = da; XRSummary summarytotal = new XRSummary(); XRSummary summarytotal1 = new XRSummary(); XRSummary summarytotal3 = new XRSummary(); Bands.Add(GroupHeader1); GroupField groupField = new GroupField("Nhóm"); GroupHeader1.GroupFields.Add(groupField); xrTableCell2.DataBindings.Add("Text", DataSource, "Nhóm"); xrTableCell4.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); XRSummary summary = new XRSummary(); summary.Running = SummaryRunning.Group; summary.IgnoreNullValues = true; summary.FormatString = "{0:n0}"; xrTableCell4.Summary = summary; xrTableCell5.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}"); XRSummary summary1 = new XRSummary(); summary1.Running = SummaryRunning.Group; summary1.IgnoreNullValues = true; summary1.FormatString = "{0:n2}"; xrTableCell5.Summary = summary1; summarytotal.Running = SummaryRunning.Report; summarytotal.IgnoreNullValues = true; summarytotal.FormatString = "{0:n0}"; xrTableCell22.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); xrTableCell22.Summary = summarytotal; summarytotal1.Running = SummaryRunning.Report; summarytotal1.IgnoreNullValues = true; summarytotal1.FormatString = "{0:n2}"; xrTableCell23.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}"); xrTableCell23.Summary = summarytotal1; xrTableCell16.DataBindings.Add("Text", DataSource, "Mã hàng"); xrTableCell10.DataBindings.Add("Text", DataSource, "Tên hàng"); xrTableCell11.DataBindings.Add("Text", DataSource, "Số lượng", "{0:n0}"); xrTableCell12.DataBindings.Add("Text", DataSource, "Số lượng quy đổi", "{0:n2}"); }
public XtraReport CreateDataGroupingReport() { // Create a report, and bind it to a data source. XtraReport report = new XtraReport(); nwindDataSet ds = new nwindDataSet(); new nwindDataSetTableAdapters.OrdersTableAdapter().Fill(ds.Orders); report.DataSource = ds; report.DataMember = "Orders"; // Create a detail band and add it to the report. DetailBand detailBand = new DetailBand(); detailBand.Height = 20; report.Bands.Add(detailBand); // Create a group header band and add it to the report. GroupHeaderBand ghBand = new GroupHeaderBand(); ghBand.Height = 20; report.Bands.Add(ghBand); // Create a calculated field, and add it to the report's collection CalculatedField calcField = new CalculatedField(report.DataSource, report.DataMember); report.CalculatedFields.Add(calcField); // Define its name, field type and expression. // Note that numerous built-in date-time functions are supported. calcField.Name = "dayOfWeek"; calcField.FieldType = FieldType.None; calcField.Expression = "GetDayOfWeek([OrderDate])"; // Define the calculated field as // a grouping criteria for the group header band. GroupField groupField = new GroupField(); groupField.FieldName = "dayOfWeek"; ghBand.GroupFields.Add(groupField); // Create two data-bound labels, and add them to // the corresponding bands. XRLabel ghLabel = new XRLabel(); ghLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:dddd}"); ghLabel.BackColor = Color.Red; ghBand.Controls.Add(ghLabel); XRLabel detailLabel = new XRLabel(); detailLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:MM/dd/yyyy}"); detailLabel.ProcessDuplicatesTarget = ProcessDuplicatesTarget.Value; detailLabel.ProcessDuplicatesMode = ProcessDuplicatesMode.Suppress; detailBand.Controls.Add(detailLabel); return(report); }
public void BindData(DataTable da) { DataSource = da; Bands.Add(GroupHeader1); GroupField groupField = new GroupField("Đơn vị"); GroupHeader1.GroupFields.Add(groupField); xrTableCell43.DataBindings.Add("Text", DataSource, "Đơn vị"); XRSummary summarytotal = new XRSummary(); XRSummary summarytotal1 = new XRSummary(); XRSummary summarytotal3 = new XRSummary(); XRSummary summarytotal4 = new XRSummary(); XRSummary summarytotal5 = new XRSummary(); XRSummary summarytotal6 = new XRSummary(); XRSummary summarytotal7 = new XRSummary(); XRSummary summarytotal8 = new XRSummary(); summarytotal.Running = SummaryRunning.Report; summarytotal.IgnoreNullValues = true; summarytotal.FormatString = "{0:n0}"; xrTableCell32.DataBindings.Add("Text", DataSource, "Số quá hạn", "{0:n0}"); xrTableCell32.Summary = summarytotal; /*summarytotal1.Running = SummaryRunning.Report; * summarytotal1.IgnoreNullValues = true; * summarytotal1.FormatString = "{0:n0}"; * xrTableCell23.DataBindings.Add("Text", DataSource, "Có đầu kỳ", "{0:n0}"); * xrTableCell23.Summary = summarytotal1; * * summarytotal3.Running = SummaryRunning.Report; * summarytotal3.IgnoreNullValues = true; * summarytotal3.FormatString = "{0:n0}"; * xrTableCell24.DataBindings.Add("Text", DataSource, "Nợ phát sinh", "{0:n0}"); * xrTableCell24.Summary = summarytotal3; * * summarytotal4.Running = SummaryRunning.Report; * summarytotal4.IgnoreNullValues = true; * summarytotal4.FormatString = "{0:n0}"; * xrTableCell25.DataBindings.Add("Text", DataSource, "Có phát sinh", "{0:n0}"); * xrTableCell25.Summary = summarytotal4;*/ xrTableCell15.DataBindings.Add("Text", DataSource, "Phiếu"); xrTableCell16.DataBindings.Add("Text", DataSource, "Hóa đơn"); xrTableCell17.DataBindings.Add("Text", DataSource, "Hạn nợ"); xrTableCell18.DataBindings.Add("Text", DataSource, "Số tiền nợ", "{0:0,0}"); xrTableCell19.DataBindings.Add("Text", DataSource, "Ngày nợ", "{0:dd-MM-yyyy}"); xrTableCell20.DataBindings.Add("Text", DataSource, "Phiếu trả"); xrTableCell21.DataBindings.Add("Text", DataSource, "Số tiền trả", "{0:0,0}"); xrTableCell22.DataBindings.Add("Text", DataSource, "Ngày trả", "{0:dd-MM-yyyy}"); xrTableCell23.DataBindings.Add("Text", DataSource, "Số dư nợ", "{0:0,0}"); xrTableCell31.DataBindings.Add("Text", DataSource, "Số quá hạn", "{0:0,0}"); xrTableCell34.DataBindings.Add("Text", DataSource, "Số ngày", "{0:n0}"); }
protected override bool beforeUpdate() { MapDtl dtl = new MapDtl(this.No); //启用审核 dtl.IsEnablePass = this.IsEnablePass; //超链接 dtl.IsEnableLink = this.IsEnableLink; dtl.LinkLabel = this.LinkLabel; dtl.LinkUrl = this.LinkUrl; dtl.LinkTarget = this.LinkTarget; dtl.Update(); //获得事件实体. var febd = BP.Sys.Glo.GetFormDtlEventBaseByEnName(this.No); if (febd == null) { this.FEBD = ""; } else { this.FEBD = febd.ToString(); } #region 检查填充的SQL是否符合要求. #endregion //更新分组标签. @fanleiwei. 代码有变化. BP.Sys.GroupField gf = new GroupField(); int i = gf.Retrieve(GroupFieldAttr.CtrlType, "Dtl", GroupFieldAttr.CtrlID, this.No); if (i == 0) { gf.CtrlID = this.No; gf.CtrlType = "Dtl"; gf.FrmID = this.FK_MapData; gf.Insert(); } if (i > 1) { gf.Delete(); i = gf.Retrieve(GroupFieldAttr.CtrlType, "Dtl", GroupFieldAttr.CtrlID, this.No); } if (i == 1 && gf.Lab.Equals(this.Name) == false) { gf.Lab = this.Name; gf.Update(); } return(base.beforeUpdate()); }
public XtraReport CreateDataGroupingReport() { // Create a report, and bind it to a data source. XtraReport report = new XtraReport(); DataSet1 ds = new DataSet1(); new DataSet1TableAdapters.OrdersTableAdapter().Fill(ds.Orders); report.DataSource = ds; report.DataMember = "Orders"; // Create a detail band and add it to the report. DetailBand detailBand = new DetailBand(); detailBand.Height = 20; report.Bands.Add(detailBand); // Create a group header band and add it to the report. GroupHeaderBand ghBand = new GroupHeaderBand(); ghBand.Height = 20; report.Bands.Add(ghBand); // Create a calculated field, and add it to the report's collection CalculatedField calcField = new CalculatedField(report.DataSource, report.DataMember); report.CalculatedFields.Add(calcField); // Define its name, field type and expression. // Note that numerous built-in date-time functions are supported. calcField.Name = "dayOfWeek"; calcField.FieldType = FieldType.None; calcField.Expression = "GetDayOfWeek([OrderDate])"; // Define the calculated field as // a grouping criteria for the group header band. GroupField groupField = new GroupField(); groupField.FieldName = "dayOfWeek"; ghBand.GroupFields.Add(groupField); // Create two data-bound labels, and add them to // the corresponding bands. XRLabel ghLabel = new XRLabel(); ghLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:dddd}"); ghLabel.BackColor = Color.Red; ghBand.Controls.Add(ghLabel); XRLabel detailLabel = new XRLabel(); detailLabel.DataBindings.Add("Text", report.DataSource, "OrderDate", "{0:MM/dd/yyyy}"); detailLabel.ProcessDuplicates = ValueSuppressType.Suppress; detailBand.Controls.Add(detailLabel); return report; }
private void IntGROUP() { GroupField _GroupFieldLoaiTaiSan = new GroupField("loaitaisan"); GroupHeader_LoaiTaiSan.GroupFields.Add(_GroupFieldLoaiTaiSan); xrTableCell_GROUP_Name.DataBindings.Add("Text", this.DataSource, "tenloaitaisan"); xrTableCell_GROUP_NguyenGia.DataBindings.Add("Text", this.DataSource, "dongia"); xrTableCell_GROUP_NguyenGia.Summary.FormatString = "{0:### ### ### ### ### ###}"; xrTableCell_GROUP_NguyenGia.Summary.IgnoreNullValues = true; xrTableCell_GROUP_NguyenGia.Summary.Func = SummaryFunc.Sum; xrTableCell_GROUP_NguyenGia.Summary.Running = SummaryRunning.Group; xrTableCell_GROUP_NguyenGia.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; xrTableCell_GROUP_NguyenGia.XlsxFormatString = "### ### ### ###"; xrTableCell_GROUP_HaoMonDauKy.DataBindings.Add("Text", this.DataSource, "haomonnamtruocchuyensang"); xrTableCell_GROUP_HaoMonDauKy.Summary.FormatString = "{0:### ### ### ### ### ###}"; xrTableCell_GROUP_HaoMonDauKy.Summary.IgnoreNullValues = true; xrTableCell_GROUP_HaoMonDauKy.Summary.Func = SummaryFunc.Sum; xrTableCell_GROUP_HaoMonDauKy.Summary.Running = SummaryRunning.Group; xrTableCell_GROUP_HaoMonDauKy.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; xrTableCell_GROUP_HaoMonDauKy.XlsxFormatString = "### ### ### ###"; xrTableCell_GROUP_HaoMonTrongKy.DataBindings.Add("Text", this.DataSource, "haomon_1nam"); xrTableCell_GROUP_HaoMonTrongKy.Summary.FormatString = "{0:### ### ### ### ### ###}"; xrTableCell_GROUP_HaoMonTrongKy.Summary.IgnoreNullValues = true; xrTableCell_GROUP_HaoMonTrongKy.Summary.Func = SummaryFunc.Sum; xrTableCell_GROUP_HaoMonTrongKy.Summary.Running = SummaryRunning.Group; xrTableCell_GROUP_HaoMonTrongKy.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; xrTableCell_GROUP_HaoMonTrongKy.XlsxFormatString = "### ### ### ###"; xrTableCell_GROUP_HaoMonLuyKe.DataBindings.Add("Text", this.DataSource, "haomonluyke"); xrTableCell_GROUP_HaoMonLuyKe.Summary.FormatString = "{0:### ### ### ### ### ###}"; xrTableCell_GROUP_HaoMonLuyKe.Summary.IgnoreNullValues = true; xrTableCell_GROUP_HaoMonLuyKe.Summary.Func = SummaryFunc.Sum; xrTableCell_GROUP_HaoMonLuyKe.Summary.Running = SummaryRunning.Group; xrTableCell_GROUP_HaoMonLuyKe.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; xrTableCell_GROUP_HaoMonLuyKe.XlsxFormatString = "### ### ### ###"; xrTableCell_GROUP_GiaTriConLai.DataBindings.Add("Text", this.DataSource, "giatriconlai_final"); xrTableCell_GROUP_GiaTriConLai.Summary.FormatString = "{0:### ### ### ### ### ###}"; xrTableCell_GROUP_GiaTriConLai.Summary.IgnoreNullValues = true; xrTableCell_GROUP_GiaTriConLai.Summary.Func = SummaryFunc.Sum; xrTableCell_GROUP_GiaTriConLai.Summary.Running = SummaryRunning.Group; xrTableCell_GROUP_GiaTriConLai.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; xrTableCell_GROUP_GiaTriConLai.XlsxFormatString = "### ### ### ###"; }
private List<int> GetGroupByField(GroupField field) { List<int> result; switch (field) { case GroupField.Cost: result = _products.Select(x => x.Cost).ToList(); break; case GroupField.Revenue: result = _products.Select(x => x.Revenue).ToList(); break; default: result = _products.Select(x => x.Cost).ToList(); break; } return result; }
public CGSHReport(string strCGSHID) { InitializeComponent(); OracleConnection con = new OracleConnection(FrmLogin.strDataCent); string sql = "select a.cgshid, a.ztmc, a.cgshdh, a.ysdh, a.sszpz, a.sszsl, a.sszmy, a.sszsy, a.shrxm, a.czyxm, a.zdrq, a.gysmc, " + "a.statusmc, b.pm, b.spbh, b.dj, b.bz, b.sssl, b.ssmy, b.sssy from view_jt_g_cgsh a " + "left join view_jt_g_cgshmx b on a.cgshid = b.cgshid where a.cgshid in (" + strCGSHID + ")"; OracleDataAdapter Ada = new OracleDataAdapter(sql, con); DataSet ds = new DataSet(); Ada.Fill(ds); this.DataAdapter = Ada; this.DataSource = ds; GroupField groupField = new GroupField("CGSHID"); GroupHeader1.GroupFields.Add(groupField); this.xrTableCell1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "spbh")}); this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "pm")}); this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "dj", "{0:c2}")}); this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sssl")}); this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ssmy", "{0:c2}")}); this.xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sssy", "{0:c2}")}); this.xrTableCell7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "bz")}); this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ztmc", "{0} �ջ���")}); this.xrLabel4.Text = FrmLogin.getUserName; this.xrLabel5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "cgshdh", "���ţ�{0}")}); this.xrLabel6.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ysdh", "ԭʼ���ţ�{0}")}); this.xrLabel7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sszpz", "ʵ��Ʒ�֣�{0}")}); this.xrLabel8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sszsl", "ʵ��������{0}")}); this.xrLabel9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sszmy", "ʵ������{0:c2}")}); this.xrLabel10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "sszsy", "ʵ��ʵ��{0:c2}")}); this.xrLabel11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "shrxm", "����ˣ�{0}")}); this.xrLabel12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czyxm", "����Ա��{0}")}); this.xrLabel13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "zdrq", "�Ƶ����ڣ�{0}")}); this.xrLabel14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "gysmc", "��Ӧ�̣�{0}")}); this.xrLabel15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "statusmc", "״̬��{0}")}); }
public XSHZDReport(string strXSHZDID, bool fgBranch) { string sql = ""; InitializeComponent(); if (fgBranch) { sql = "select a.xshzdid, a.xshzdh, a.ywbmmc, a.fxflsl1, a.fxflje1, a.fxflsl2, a.fxflje2, a.fxflsl3, a.fxflje3, " + "a.fxflsl4, a.fxflje4, a.fxflsl5, a.fxflje5, a.fxflsl6, a.fxflje6, a.fxflsl7, a.fxflje7, a.fxflsl8, a.fxflje8, " + "a.fxflsl9, a.fxflje9, a.fxflsl10, a.fxflje10, a.hjsl, a.hjje, a.xszksl, a.xszkje, a.jshj," + " a.czyxm, a.zdrq from VIEW_JC_C_XSHZD a where a.xshzdid in (" + strXSHZDID + ")"; } else { sql = "select a.xshzdid, a.xshzdh, a.ywbmmc, a.fxflsl1, a.fxflje1, a.fxflsl2, a.fxflje2, a.fxflsl3, a.fxflje3, " + "a.fxflsl4, a.fxflje4, a.fxflsl5, a.fxflje5, a.fxflsl6, a.fxflje6, a.fxflsl7, a.fxflje7, a.fxflsl8, a.fxflje8, " + "a.fxflsl9, a.fxflje9, a.fxflsl10, a.fxflje10, a.hjsl, a.hjje, a.xszksl, a.xszkje, a.jshj," + " a.czyxm, a.zdrq from VIEW_JT_C_XSHZD a where a.xshzdid in (" + strXSHZDID + ")"; } OracleConnection con = new OracleConnection(FrmLogin.strDataCent); OracleDataAdapter Ada = new OracleDataAdapter(sql, con); DataSet ds = new DataSet(); Ada.Fill(ds); this.DataAdapter = Ada; this.DataSource = ds; GroupField groupField = new GroupField("XSHZDID"); GroupHeader1.GroupFields.Add(groupField); xrTableCell1.Text = FrmLogin.getZTMC; xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ywbmmc", "���ţ�{0}")}); xrTableCell5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "zdrq", "ʱ�䣺{0}")}); xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xshzdh")}); xrTableCell63.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czyxm", "�Ƶ��ˣ�{0}")}); xrTableCell11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl1")}); xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje1", "{0:c2}")}); xrTableCell15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl2")}); xrTableCell16.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje2", "{0:c2}")}); xrTableCell19.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl3")}); xrTableCell20.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje3", "{0:c2}")}); xrTableCell23.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl4")}); xrTableCell24.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje4", "{0:c2}")}); xrTableCell27.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl5")}); xrTableCell28.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje5", "{0:c2}")}); xrTableCell31.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl6")}); xrTableCell32.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje6", "{0:c2}")}); xrTableCell35.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl7")}); xrTableCell36.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje7", "{0:c2}")}); xrTableCell39.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl8")}); xrTableCell40.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje8", "{0:c2}")}); xrTableCell43.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl9")}); xrTableCell44.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje9", "{0:c2}")}); xrTableCell47.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflsl10")}); xrTableCell48.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fxflje10", "{0:c2}")}); xrTableCell51.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "hjsl")}); xrTableCell52.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "hjje", "{0:c2}")}); xrTableCell55.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xszksl")}); xrTableCell56.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xszkje", "{0:c2}")}); xrTableCell60.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jshj", "{0:c2}")}); }
public XSDReport(string strXSDID) { InitializeComponent(); OracleConnection con = new OracleConnection(FrmLogin.strDataCent); string sql = "select a.xsdid, a.ztmc, a.xsdh, a.zdrq, a.jsfsmc, a.wlbmmc, a.xsbmmc, a.khmc, a.fhdz, a.czyxm, a.czrq, a.bz, a.pzs, " + "a.xssl as xszsl, a.xssy as xszsy, a.xsmy as xszmy, b.pm, b.spbh, b.dj, b.xj, b.xz, b.xssl, b.xsmy, b.xssy from view_jt_x_xsd a " + "left join view_jt_x_xsdmx b on a.xsdid = b.xsdid where a.xsdid in (" + strXSDID + ")"; OracleDataAdapter Ada = new OracleDataAdapter(sql, con); DataSet ds = new DataSet(); Ada.Fill(ds); this.DataAdapter = Ada; this.DataSource = ds; GroupField groupField = new GroupField("XSDID"); GroupHeader1.GroupFields.Add(groupField); this.xrLabel4.Text = FrmLogin.getUserName; this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ztmc", "{0} ���۵�")}); this.xrTableCell1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xsdh", "���ţ�{0}")}); this.xrTableCell2.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "zdrq", "�������ڣ�{0}")}); this.xrTableCell3.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jsfsmc", "���㷽ʽ��{0}")}); this.xrTableCell4.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "wlbmmc", "�������ţ�{0}")}); this.xrTableCell5.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xsbmmc", "���۲��ţ�{0}")}); this.xrTableCell6.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "khmc", "�ͻ����ƣ�{0}")}); this.xrTableCell7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "fhdz", "������ַ��{0}")}); this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czyxm", "����Ա��{0}")}); this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czrq", "�������ڣ�{0}")}); this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "bz", "��ע��{0}")}); this.xrTableCell11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "pzs", "����Ʒ�֣�{0}")}); this.xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xszsl", "����������{0}")}); this.xrTableCell13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xszsy", "����ʵ��{0:c2}")}); this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xszmy", "��������{0:c2}")}); this.xrTableCell23.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "spbh")}); this.xrTableCell24.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "pm")}); this.xrTableCell25.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "dj", "{0:c2}")}); this.xrTableCell26.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xj", "{0:c2}")}); this.xrTableCell27.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xz")}); this.xrTableCell28.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xssl")}); this.xrTableCell29.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xsmy", "{0:c2}")}); this.xrTableCell30.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "xssy", "{0:c2}")}); }
private void InsertGroupBand(GridColumn gridColumn, int i) { GroupHeaderBand gb = new GroupHeaderBand(); gb.Height = 25; gb.RepeatEveryPage = true; XRLabel l = new XRLabel(); l.DataBindings.Add("Text", this.DataSource, gridColumn.FieldName); l.Size = new Size(300, 25); l.Location = new Point(0 + i * 20, 0); l.BackColor = Color.Beige; gb.Controls.Add(l); GroupField gf; if (gridColumn.SortOrder == ColumnSortOrder.Ascending) { gf = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Ascending); m_count_group_col += 1; } else { gf = new GroupField(gridColumn.FieldName, XRColumnSortOrder.Descending); m_count_group_col += 1; } l.BackColor = Color.White; l.Font = new Font(l.Font.FontFamily, 12, FontStyle.Bold); gb.GroupFields.Add(gf); gb.StylePriority.UseBackColor = true; gb.BackColor = Color.Maroon; this.Bands.Add(gb); }
public JTDReport(string strJTDID) { InitializeComponent(); OracleConnection con = new OracleConnection(FrmLogin.strDataCent); string sql = "select a.jtdid, a.ztmc, a.jtdh, a.zdrq, a.ywyxm, a.statusmc, a.czyxm, a.czrq, a.gysmc, a.bz, a.jtpzs, a.jtzsl, a.jtzmy, " + "a.jtbmmc, b.pm, b.spbh, b.dj, b.bz, b.jtsl, b.jtmy from view_jt_g_jtd a " + "left join view_jt_g_jtdmx b on a.jtdid = b.jtdid where a.jtdid in (" + strJTDID + ")"; OracleDataAdapter Ada = new OracleDataAdapter(sql, con); DataSet ds = new DataSet(); Ada.Fill(ds); this.DataAdapter = Ada; this.DataSource = ds; GroupField groupField = new GroupField("JTDID"); GroupHeader1.GroupFields.Add(groupField); this.xrLabel4.Text = FrmLogin.getUserName; this.xrLabel1.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ztmc", "{0} ���˵�")}); this.xrTableCell7.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "dj", "{0:c2}")}); this.xrTableCell12.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtmy", "{0:c2}")}); this.xrTableCell10.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "spbh")}); this.xrTableCell11.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "pm")}); this.xrTableCell8.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtsl")}); this.xrTableCell9.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "bz")}); this.xrTableCell13.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtdh", "���ţ�{0}")}); this.xrTableCell14.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "zdrq", "�������ڣ�{0}")}); this.xrTableCell16.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "ywyxm", "ҵ��Ա��{0}")}); this.xrTableCell15.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "statusmc", "״̬��{0}")}); this.xrTableCell21.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czyxm", "����Ա��{0}")}); this.xrTableCell22.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "czrq", "�������ڣ�{0}")}); this.xrTableCell23.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "gysmc", "��Ӧ�̣�{0}")}); this.xrTableCell24.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "bz", "��ע��{0}")}); this.xrTableCell17.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtpzs", "����Ʒ�֣�{0}")}); this.xrTableCell18.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtzsl", "����������{0}")}); this.xrTableCell19.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtzmy", "��������{0:c2}")}); this.xrTableCell20.DataBindings.AddRange(new DevExpress.XtraReports.UI.XRBinding[] { new DevExpress.XtraReports.UI.XRBinding("Text", null, "jtbmmc", "���˲��ţ�{0}")}); }
public void InitTables(List<SHARED.Libraries.ReportHelper.structColumn> ListColumns, GridView _GridView) { int colCount = ListColumns.Count; int pageWidth = (PageWidth - (Margins.Left + Margins.Right)); int colWidth = pageWidth / colCount; if (NumberOfFieldGroup > 0) { colWidth = (pageWidth - GroupColumnLength) / colCount; for (int i = _GridView.GroupCount - 1; i >= 0; i--) { XRTable XRTable_GroupHeaderBand = new XRTable(); XRTable_GroupHeaderBand.Styles.Style = this.myRowStyle; XRTable_GroupHeaderBand.LocationF = new DevExpress.Utils.PointFloat(0 + i * WidthAdd, 0); XRTableRow XRTableRow_GroupHeaderBand = new XRTableRow(); XRTableCell XRTableCell_GroupText = new XRTableCell(); if (Object.Equals(_GridView.GroupedColumns[i].ColumnType, typeof(Int32))) { XRTableCell_GroupText.DataBindings.Add("Text", this.DataSource, _GridView.GroupedColumns[i].Name + "_" + _GridView.GroupedColumns[i].FieldName + strTag); } else { XRTableCell_GroupText.DataBindings.Add("Text", this.DataSource, _GridView.GroupedColumns[i].Name + "_" + _GridView.GroupedColumns[i].FieldName); } XRTableCell_GroupText.Width = GroupColumnLength - i * WidthAdd; XRTableRow_GroupHeaderBand.Cells.Add(XRTableCell_GroupText); for (int j = 0; j < colCount; j++) { XRTableCell XRTableCell_SumColumn = new XRTableCell(); XRTableCell_SumColumn.Width = (int)colWidth; if (ListColumns[j].IsNumber) { XRTableCell_SumColumn.DataBindings.Add("Text", this.DataSource, ListColumns[j].FieldName); XRTableCell_SumColumn.Summary.IgnoreNullValues = true; XRTableCell_SumColumn.Summary.Func = SummaryFunc.Sum; XRTableCell_SumColumn.Summary.Running = SummaryRunning.Group; XRTableCell_SumColumn.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; } else { XRTableCell_SumColumn.Text = ""; } XRTableRow_GroupHeaderBand.Cells.Add(XRTableCell_SumColumn); } XRTable_GroupHeaderBand.Rows.Add(XRTableRow_GroupHeaderBand); XRTable_GroupHeaderBand.Width = pageWidth - (i * WidthAdd); GroupHeaderBand _GroupHeaderBand = new GroupHeaderBand(); _GroupHeaderBand.Controls.Add(XRTable_GroupHeaderBand); _GroupHeaderBand.Height = XRTable_GroupHeaderBand.Height; GroupField _GroupField = new GroupField(_GridView.GroupedColumns[i].Name + "_" + _GridView.GroupedColumns[i].FieldName); _GroupHeaderBand.GroupFields.Add(_GroupField); this.Bands.Add(_GroupHeaderBand); } } XRTable XRTable_PageHeader = null; if (NumberOfFieldGroup > 0) { XRTable_PageHeader = SHARED.Libraries.ReportHelper.CreatePageHeaderTable(ListColumns, pageWidth, colWidth, true, GroupColumnLength); } else { XRTable_PageHeader = SHARED.Libraries.ReportHelper.CreatePageHeaderTable(ListColumns, pageWidth, colWidth, false, 0); } if (!Object.Equals(XRTable_PageHeader, null)) { XRTable_PageHeader.Styles.Style = this.myColumnStyle; Bands[BandKind.PageHeader].Controls.Add(XRTable_PageHeader); } XRTable XRTable_Detail = new XRTable(); XRTableRow XRTableRow_Detail = new XRTableRow(); for (int i = 0; i < colCount; i++) { XRTableCell XRTableCell_Cell = new XRTableCell(); XRTableCell_Cell.Width = (int)colWidth; XRTableCell_Cell.DataBindings.Add("Text", null, ListColumns[i].FieldName); if (ListColumns[i].IsNumber) XRTableCell_Cell.TextAlignment = DevExpress.XtraPrinting.TextAlignment.MiddleRight; XRTableRow_Detail.Cells.Add(XRTableCell_Cell); } XRTable_Detail.Rows.Add(XRTableRow_Detail); if (NumberOfFieldGroup > 0) XRTable_Detail.LocationF = new DevExpress.Utils.PointFloat((float)(GroupColumnLength), 0F); XRTable_Detail.Width = pageWidth - GroupColumnLength; XRTable_Detail.Name = "XRTableRow_Detail"; XRTable_Detail.Styles.Style = this.myRowStyle; Bands[BandKind.Detail].Controls.Add(XRTable_Detail); XRTable XRTable_LastSum = null; if (NumberOfFieldGroup > 0) { XRTable_LastSum = SHARED.Libraries.ReportHelper.CreateLastSUMTable(this, ListColumns, pageWidth, colWidth, true, GroupColumnLength); } else { XRTable_LastSum = SHARED.Libraries.ReportHelper.CreateLastSUMTable(this, ListColumns, pageWidth, colWidth, false, 0); } if (!Object.Equals(XRTable_LastSum, null)) { XRTable_LastSum.Styles.Style = this.myRowStyle; XRTable_LastSum.Location = new Point(0, 0); XRTable_LastSum.Width = pageWidth; Bands[BandKind.ReportFooter].Controls.Add(XRTable_LastSum); } }
void InitGroupHeaders(ASPxGridView aspxGridView1) { ReadOnlyCollection<GridViewDataColumn> groupedColumns = aspxGridView1.GetGroupedColumns(); for (int i = groupedColumns.Count - 1; i >= 0; i--) { { GridViewDataColumn groupedColumn = groupedColumns[i]; GroupHeaderBand gb = new GroupHeaderBand(); gb.Height = bandHeight; XRLabel l = new XRLabel(); l.Text = groupedColumn.FieldName + ": [" + groupedColumn.FieldName + "]"; l.LocationF = new PointF(initialGroupOffset + i * 10, 0); l.BackColor = Color.Beige; l.SizeF = new SizeF((report.PageWidth - (report.Margins.Left + report.Margins.Right)) - (initialGroupOffset + i * subGroupOffset), bandHeight); gb.Controls.Add(l); gb.RepeatEveryPage = shouldRepeatGroupHeadersOnEveryPage; GroupField gf = new GroupField(groupedColumn.FieldName, groupedColumn.SortOrder == ColumnSortOrder.Ascending ? XRColumnSortOrder.Ascending : XRColumnSortOrder.Descending); gb.GroupFields.Add(gf); report.Bands.Add(gb); } } }
public ComposedGroupFieldInfo(GroupField groupField) { if (groupField == null) throw new ArgumentNullException(nameof(groupField)); GroupField = groupField; }