using System; using System.Drawing; using System.Collections; using System.ComponentModel; using DevExpress.XtraReports.UI; using PublicLib; using System.Data; using System.Windows.Forms; namespace HANMI_J_SALE { public partial class CreditSalesReport : DevExpress.XtraReports.UI.XtraReport { public CreditSalesReport() { InitializeComponent(); } public void SetData(DataTable m_data, DataTable d_data, string order_date) { DataTable aData = new DataTable(); aData.Columns.Add("CUST_CD", typeof(string)); aData.Columns.Add("CUST_NM", typeof(string)); aData.Columns.Add("EMAIL", typeof(string)); aData.Columns.Add("TEL_NO", typeof(string)); aData.Columns.Add("FAX_NO", typeof(string)); aData.Columns.Add("ORDER_DATE", typeof(string)); aData.Columns.Add("FILE_NM", typeof(string)); aData.Columns.Add("ITEM_NM", typeof(string)); aData.Columns.Add("ORDER_NORM", typeof(string)); aData.Columns.Add("ORDER_QTY", typeof(int)); aData.Columns.Add("FIN_QTY", typeof(int)); aData.Columns.Add("ORDER_MY", typeof(int)); aData.Columns.Add("LN_RMK", typeof(string)); aData.Columns.Add("PREV_MONTH_MY", typeof(int)); aData.Columns.Add("CURR_MY", typeof(int)); aData.Columns.Add("VAT_MY", typeof(int)); aData.Columns.Add("COL_MY", typeof(int)); aData.Columns.Add("NOW_MONEY_MY", typeof(int)); DataRow[] rows; DataRow row; for (int i = 0; i < m_data.Rows.Count; i++) { rows = d_data.Select("CUST_CD = '" + UtilClass.toStr(m_data.Rows[i]["CUST_CD"]) + "'"); if (rows == null || rows.Length < 1) { continue; } foreach (DataRow aRow in rows) { if (UtilClass.isEqual(aRow["ORDER_DATE"], "☆")) { continue; } row = aData.NewRow(); row["CUST_CD"] = m_data.Rows[i]["CUST_CD"]; row["CUST_NM"] = m_data.Rows[i]["CUST_NM"]; row["EMAIL"] = m_data.Rows[i]["EMAIL"]; row["TEL_NO"] = m_data.Rows[i]["TEL_NO"]; row["FAX_NO"] = m_data.Rows[i]["FAX_NO"]; row["PREV_MONTH_MY"] = m_data.Rows[i]["PREV_MONTH_MY"]; row["CURR_MY"] = m_data.Rows[i]["CURR_MY"]; row["VAT_MY"] = m_data.Rows[i]["VAT_MY"]; row["COL_MY"] = m_data.Rows[i]["COL_MY"]; row["NOW_MONEY_MY"] = m_data.Rows[i]["NOW_MONEY_MY"]; row["ORDER_DATE"] = aRow["ORDER_DATE"]; row["FILE_NM"] = aRow["FILE_NM"]; row["ITEM_NM"] = aRow["ITEM_NM"]; row["ORDER_NORM"] = aRow["ORDER_NORM"]; row["ORDER_QTY"] = aRow["ORDER_QTY"]; row["FIN_QTY"] = aRow["FIN_QTY"]; row["ORDER_MY"] = aRow["ORDER_MY"]; row["LN_RMK"] = aRow["LN_RMK"]; aData.Rows.Add(row); } } setDataBinding(aData, order_date); } public void setDataBinding(DataTable aData, string yymm) { xrLabel_YYMM.Text = "조회연월 : " + yymm; xrTableCell_CUST_NM.DataBindings.Add("Text", aData, "CUST_NM"); xrTableCell_PREV_MONTH_MY.DataBindings.Add("Text", aData, "PREV_MONTH_MY", "{0:#,##0}"); xrTableCell_SALES_MY.DataBindings.Add("Text", aData, "SALES_MY", "{0:#,##0}"); xrTableCell_COL_MY.DataBindings.Add("Text", aData, "COL_MY", "{0:#,##0}"); xrTableCell_CURR_MY.DataBindings.Add("Text", aData, "CURR_MY", "{0:#,##0}"); xrTableCell_REMARK.DataBindings.Add("Text", aData, "REMARK", "{0:#,##0}"); xrTableCell_PREV_MONTH_MY_SUM.DataBindings.Add("Text", aData, "PREV_MONTH_MY", "{0:#,##0}"); xrTableCell_SALES_MY_SUM.DataBindings.Add("Text", aData, "SALES_MY", "{0:#,##0}"); xrTableCell_COL_MY_SUM.DataBindings.Add("Text", aData, "COL_MY", "{0:#,##0}"); xrTableCell_CURR_MY_SUM.DataBindings.Add("Text", aData, "CURR_MY", "{0:#,##0}"); this.DataSource = aData; } } }