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_SALE { public partial class BillManagerReport : DevExpress.XtraReports.UI.XtraReport { // private DataTable m_Data; private BillManager m_BillManager; public BillManagerReport(BillManager billManager) { InitializeComponent(); m_BillManager = billManager; this.AfterPrint += (sender, e) => { // this.Pages.Insert(this.Pages.Count, drawingReport.Pages[i]); }; } //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_UNIT_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_UNIT_MY"] = m_data.Rows[i]["CURR_UNIT_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 order_date) { xrLabel_ORDER_DATE.Text = "일자 : " + order_date; if (UtilClass.isEqual(ConstClass._USER, "H1_DB")) { //xrLabel_COMPANY1.Text = "하나은행 (주)한미칼라 139-910019-12704"; // 2020.01.02 하나->국민 xrLabel_COMPANY1.Text = "국민은행 (주)한미칼라 003101-04-043081"; xrLabel_COMPANY2.Text = "* 한미칼라 신사옥 주소 : 서울 특별시 중구 서애로5길 17"; } else { xrLabel_COMPANY1.Text = ""; xrLabel_COMPANY2.Text = ""; } xrLabel_CUST_NM.DataBindings.Add("Text", aData, "CUST_NM"); xrLabel_FAX_NO.DataBindings.Add("Text", aData, "FAX_NO"); xrTableCell_ORDER_DATE.DataBindings.Add("Text", aData, "ORDER_DATE"); xrTableCell_FILE_NM.DataBindings.Add("Text", aData, "FILE_NM"); xrTableCell_ITEM_NM.DataBindings.Add("Text", aData, "ITEM_NM"); xrTableCell_ORDER_NORM.DataBindings.Add("Text", aData, "ORDER_NORM"); xrTableCell_ORDER_QTY.DataBindings.Add("Text", aData, "ORDER_QTY", "{0:#,###}"); xrTableCell_FIN_QTY.DataBindings.Add("Text", aData, "FIN_QTY", "{0:#,###}"); xrTableCell_CURR_UNIT_MY.DataBindings.Add("Text", aData, "CURR_UNIT_MY", "{0:#,###}"); xrTableCell_CURR_MY.DataBindings.Add("Text", aData, "CURR_MY", "{0:#,###}"); xrTableCell_LN_RMK.DataBindings.Add("Text", aData, "LN_RMK"); xrLabel_PREV_MONTH_MY.DataBindings.Add("Text", aData, "PREV_MONTH_MY", "{0:#,##0}"); xrLabel_CURR_MY.DataBindings.Add("Text", aData, "SUM_CURR_MY", "{0:#,##0}"); xrLabel_VAT_MY.DataBindings.Add("Text", aData, "VAT_MY", "{0:#,##0}"); xrLabel_ORDER_MY.DataBindings.Add("Text", aData, "SUM_MY", "{0:#,##0}"); xrLabel_COL_MY.DataBindings.Add("Text", aData, "COL_MY", "{0:#,##0}"); xrLabel_NOW_MONEY_MY.DataBindings.Add("Text", aData, "TMP_JAN", "{0:#,##0}"); this.GroupHeader_CUST_CD.GroupFields.Add(new GroupField("CUST_NM_CD", XRColumnSortOrder.Ascending)); //this.GroupFooter_CUST_CD.GroupFields.Add(new GroupField("CUST_NM_CD", XRColumnSortOrder.Ascending)); this.DataSource = aData; } } }