using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FEQ0000 { public static class UTIL_EQ0000 { public static string getmaxstr(string src, int len = 30) { if (src.Length > len) return src.Substring(0, len) + "..."; else return src; } public static string MakeDataTableToHTML(List rows, string savefilenamexls = "") { libxl.Book book = null;// = new libxl.BinBook(); libxl.Sheet sheet = null; libxl.Format fTitle = null; libxl.Format fDataStr = null; libxl.Format fDataNum = null; if (savefilenamexls.isEmpty() == false) { book = new libxl.XmlBook(); book.setKey(FCOMMON.info.libxlCompany, FCOMMON.info.libxlKey); sheet = book.addSheet("Data"); fTitle = book.addFormat(); fDataStr = book.addFormat(); fDataNum = book.addFormat(); fDataStr.alignH = libxl.AlignH.ALIGNH_CENTER; fDataStr.alignV = libxl.AlignV.ALIGNV_CENTER; fDataStr.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataStr.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataStr.patternForegroundColor = libxl.Color.COLOR_WHITE; fTitle.alignV = libxl.AlignV.ALIGNV_CENTER; fTitle.alignH = libxl.AlignH.ALIGNH_CENTER; fTitle.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fTitle.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fTitle.patternForegroundColor = libxl.Color.COLOR_GRAY25; fDataNum.alignH = libxl.AlignH.ALIGNH_GENERAL; fDataNum.alignV = libxl.AlignV.ALIGNV_CENTER; fDataNum.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataNum.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataNum.patternForegroundColor = libxl.Color.COLOR_WHITE; } //목록을 본문에 추가한다 System.Text.StringBuilder sb = new StringBuilder(); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); var row = 0; var col = 0; if (sheet != null) { var basewidth = 15; sheet.setRow(row, 30); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "No", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "S/C", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "자재번호", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "청구자", fTitle); sheet.setCol(col, (int)(basewidth * 2)); sheet.writeStr(row, col++, "품목", fTitle); sheet.setCol(col, (int)(basewidth * 3)); sheet.writeStr(row, col++, "규격", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "수량", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "단가", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "금액", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "공급업체", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "용도", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "요청부서", fTitle); } decimal totalamt = 0; row = 1; col = 0; foreach (dsPurchase.EETGW_PurchaseEBRow dr in rows) { var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value; var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value; var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value; var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value; var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value; var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value; var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value; var s공급 = dr.IssupplyNull() ? "" : dr.supply;// fpSpread1_Sheet1.Cells[i, col_공급].Value; var s비고 = dr.IsbigoNull() ? "" : dr.bigo;// fpSpread1_Sheet1.Cells[i, col_비고].Value; var sSITE = dr.IssiteNull() ? "" : dr.site;// fpSpread1_Sheet1.Cells[i, col_site].Value; var s분류 = dr.IsdeptNull() ? "" : dr.dept; var sSC = dr.IsscNull() ? "" : dr.sc;// totalamt += amt; sb.AppendLine(""); sb.AppendLine($""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); if (sheet != null) { col = 0; sheet.setRow(row, 23); sheet.writeNum(row, col++, row, fDataNum); sheet.writeStr(row, col++, sSC, fDataStr); sheet.writeStr(row, col++, sSID, fDataStr); sheet.writeStr(row, col++, s요청, fDataStr); sheet.writeStr(row, col++, s품명, fDataStr); sheet.writeStr(row, col++, s규격, fDataStr); sheet.writeNum(row, col++, qty, fDataNum); sheet.writeNum(row, col++, (int)price, fDataNum); sheet.writeNum(row, col++, (int)amt, fDataNum); sheet.writeStr(row, col++, s공급, fDataStr); sheet.writeStr(row, col++, s비고, fDataStr); sheet.writeStr(row, col++, "전자실", fDataStr); row += 1; } ////sb.AppendLine(""); //''sb.AppendLine(""); //sb.AppendLine(""); //sb.AppendLine(""); sb.AppendLine(""); } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine("
       TOTAL{금액}  
NoSC자재번호청구자품목규격수량단가금액공급업체용도요청부서
{row}" + getmaxstr(sSC) + "" + getmaxstr(sSID) + "" + getmaxstr(s요청) + "" + getmaxstr(s품명) + "" + getmaxstr(s규격) + "" + qty.ToString("N0") + "" + price.ToString("N0") + "" + amt.ToString("N0") + "" + getmaxstr(s공급) + "" + s비고 + "전자실" + getmaxstr(sSTIE) + "" + getmaxstr(s분류) + "" + getmaxstr(sCRCF) + "" + getmaxstr(s수령) + "
       TOTAL{금액} 
"); if (sheet != null) { col = 0; sheet.setRow(row, 30); sheet.writeStr(row, col++, "합계", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeNum(row, col++, (int)totalamt, fTitle); sheet.setMerge(row, row, col - 1, col); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); row += 1; } if (book != null) { try { book.save(savefilenamexls); } catch { } } return sb.ToString().Replace("{금액}", totalamt.ToString("N0")); } public static string MakeDataTableToHTML(List rows, string savefilenamexls = "") { libxl.Book book = null;// = new libxl.BinBook(); libxl.Sheet sheet = null; libxl.Format fTitle = null; libxl.Format fDataStr = null; libxl.Format fDataNum = null; if (savefilenamexls.isEmpty() == false) { book = new libxl.XmlBook(); book.setKey(FCOMMON.info.libxlCompany, FCOMMON.info.libxlKey); sheet = book.addSheet("Data"); fTitle = book.addFormat(); fDataStr = book.addFormat(); fDataNum = book.addFormat(); fDataStr.alignH = libxl.AlignH.ALIGNH_CENTER; fDataStr.alignV = libxl.AlignV.ALIGNV_CENTER; fDataStr.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataStr.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataStr.patternForegroundColor = libxl.Color.COLOR_WHITE; fTitle.alignV = libxl.AlignV.ALIGNV_CENTER; fTitle.alignH = libxl.AlignH.ALIGNH_CENTER; fTitle.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fTitle.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fTitle.patternForegroundColor = libxl.Color.COLOR_GRAY25; fDataNum.alignH = libxl.AlignH.ALIGNH_GENERAL; fDataNum.alignV = libxl.AlignV.ALIGNV_CENTER; fDataNum.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataNum.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataNum.patternForegroundColor = libxl.Color.COLOR_WHITE; } //목록을 본문에 추가한다 System.Text.StringBuilder sb = new StringBuilder(); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); var row = 0; var col = 0; if (sheet != null) { var basewidth = 15; sheet.setRow(row, 30); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "No", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "S/C", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "자재번호", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "청구자", fTitle); sheet.setCol(col, (int)(basewidth * 2)); sheet.writeStr(row, col++, "품목", fTitle); sheet.setCol(col, (int)(basewidth * 3)); sheet.writeStr(row, col++, "규격", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "수량", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "단가", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "금액", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "공급업체", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "용도", fTitle); } decimal totalamt = 0; row = 1; col = 0; foreach (dsPurchase.PurchaseRow dr in rows) { var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value; var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value; var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value; var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value; var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value; var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value; var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value; var s공급 = dr.IssupplyNull() ? "" : dr.supply;// fpSpread1_Sheet1.Cells[i, col_공급].Value; var s비고 = dr.IsbigoNull() ? "" : dr.bigo;// fpSpread1_Sheet1.Cells[i, col_비고].Value; //var sSITE = dr.IssiteNull() ? "" : dr.site;// fpSpread1_Sheet1.Cells[i, col_site].Value; var s분류 = dr.IsdeptNull() ? "" : dr.dept; var sSC = dr.IsscNull() ? "" : dr.sc;// totalamt += amt; sb.AppendLine(""); sb.AppendLine($""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); if (sheet != null) { col = 0; sheet.setRow(row, 23); sheet.writeNum(row, col++, row, fDataNum); sheet.writeStr(row, col++, sSC, fDataStr); sheet.writeStr(row, col++, sSID, fDataStr); sheet.writeStr(row, col++, s요청, fDataStr); sheet.writeStr(row, col++, s품명, fDataStr); sheet.writeStr(row, col++, s규격, fDataStr); sheet.writeNum(row, col++, qty, fDataNum); sheet.writeNum(row, col++, (int)price, fDataNum); sheet.writeNum(row, col++, (int)amt, fDataNum); sheet.writeStr(row, col++, s공급, fDataStr); sheet.writeStr(row, col++, s비고, fDataStr); row += 1; } ////sb.AppendLine(""); //''sb.AppendLine(""); //sb.AppendLine(""); //sb.AppendLine(""); sb.AppendLine(""); } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine("
       TOTAL{금액} 
NoSC자재번호청구자품목규격수량단가금액공급업체용도
{row}" + getmaxstr(sSC) + "" + getmaxstr(sSID) + "" + getmaxstr(s요청) + "" + getmaxstr(s품명) + "" + getmaxstr(s규격) + "" + qty.ToString("N0") + "" + price.ToString("N0") + "" + amt.ToString("N0") + "" + getmaxstr(s공급) + "" + s비고 + "" + getmaxstr(sSTIE) + "" + getmaxstr(s분류) + "" + getmaxstr(sCRCF) + "" + getmaxstr(s수령) + "
       TOTAL{금액}
"); if (sheet != null) { col = 0; sheet.setRow(row, 30); sheet.writeStr(row, col++, "합계", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeNum(row, col++, (int)totalamt, fTitle); sheet.setMerge(row, row, col - 1, col); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); row += 1; } if (book != null) { try { book.save(savefilenamexls); } catch { } } return sb.ToString().Replace("{금액}", totalamt.ToString("N0")); } public static string MakeDataTableToHTML(List rows, string savefilenamexls = "") { libxl.Book book = null;// = new libxl.BinBook(); libxl.Sheet sheet = null; libxl.Format fTitle = null; libxl.Format fDataStr = null; libxl.Format fDataNum = null; if (savefilenamexls.isEmpty() == false) { book = new libxl.XmlBook(); book.setKey(FCOMMON.info.libxlCompany, FCOMMON.info.libxlKey); sheet = book.addSheet("Data"); fTitle = book.addFormat(); fDataStr = book.addFormat(); fDataNum = book.addFormat(); fDataStr.alignH = libxl.AlignH.ALIGNH_CENTER; fDataStr.alignV = libxl.AlignV.ALIGNV_CENTER; fDataStr.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataStr.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataStr.patternForegroundColor = libxl.Color.COLOR_WHITE; fTitle.alignV = libxl.AlignV.ALIGNV_CENTER; fTitle.alignH = libxl.AlignH.ALIGNH_CENTER; fTitle.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fTitle.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fTitle.patternForegroundColor = libxl.Color.COLOR_GRAY25; fDataNum.alignH = libxl.AlignH.ALIGNH_GENERAL; fDataNum.alignV = libxl.AlignV.ALIGNV_CENTER; fDataNum.setBorder(libxl.BorderStyle.BORDERSTYLE_THIN); fDataNum.fillPattern = libxl.FillPattern.FILLPATTERN_SOLID; fDataNum.patternForegroundColor = libxl.Color.COLOR_WHITE; } //목록을 본문에 추가한다 System.Text.StringBuilder sb = new StringBuilder(); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); var row = 0; var col = 0; if (sheet != null) { var basewidth = 15; sheet.setRow(row, 30); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "S/C", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "자재번호", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "청구자", fTitle); sheet.setCol(col, (int)(basewidth * 2)); sheet.writeStr(row, col++, "품목", fTitle); sheet.setCol(col, (int)(basewidth * 3)); sheet.writeStr(row, col++, "규격", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "수량", fTitle); sheet.setCol(col, (int)(basewidth * 0.5)); sheet.writeStr(row, col++, "단가", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "금액", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "공급업체", fTitle); sheet.setCol(col, basewidth); sheet.writeStr(row, col++, "용도", fTitle); } decimal totalamt = 0; row = 1; col = 0; foreach (dsPurchase.EETGW_PurchaseCRRow dr in rows) { var s요청 = dr.IsrequestNameNull() ? "" : dr.requestName;// fpSpread1_Sheet1.Cells[i, col_요청].Value; var sSID = dr.IssidNull() ? "" : dr.sid;// fpSpread1_Sheet1.Cells[i, col_SID].Value; var s품명 = dr.IspumnameNull() ? "" : dr.pumname;// fpSpread1_Sheet1.Cells[i, col_품명].Value; var s규격 = dr.IspumunitNull() ? "" : dr.pumscale;// fpSpread1_Sheet1.Cells[i, col_규격].Value; var qty = dr.IspumqtyNull() ? 0 : dr.pumqty;// fpSpread1_Sheet1.Cells[i, col_수량].Value; var price = dr.IspumpriceNull() ? 0 : dr.pumprice;// fpSpread1_Sheet1.Cells[i, col_단가].Value; var amt = dr.IspumamtNull() ? 0 : dr.pumamt;// fpSpread1_Sheet1.Cells[i, col_금액].Value; var s공급 = dr.IssupplyNull() ? "" : dr.supply;// fpSpread1_Sheet1.Cells[i, col_공급].Value; var s비고 = dr.IsbigoNull() ? "" : dr.bigo;// fpSpread1_Sheet1.Cells[i, col_비고].Value; //var sSITE = dr.IssiteNull() ? "" : dr.site;// fpSpread1_Sheet1.Cells[i, col_site].Value; var s분류 = dr.IsdeptNull() ? "" : dr.dept; var sSC = dr.IsscNull() ? "" : dr.sc;// totalamt += amt; sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); if (sheet != null) { col = 0; sheet.setRow(row, 23); sheet.writeStr(row, col++, sSC, fDataStr); sheet.writeStr(row, col++, sSID, fDataStr); sheet.writeStr(row, col++, s요청, fDataStr); sheet.writeStr(row, col++, s품명, fDataStr); sheet.writeStr(row, col++, s규격, fDataStr); sheet.writeNum(row, col++, qty, fDataNum); sheet.writeNum(row, col++, (int)price, fDataNum); sheet.writeNum(row, col++, (int)amt, fDataNum); sheet.writeStr(row, col++, s공급, fDataStr); sheet.writeStr(row, col++, s비고, fDataStr); row += 1; } ////sb.AppendLine(""); //''sb.AppendLine(""); //sb.AppendLine(""); //sb.AppendLine(""); sb.AppendLine(""); } sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine(""); sb.AppendLine("
      TOTAL{금액} 
SC자재번호청구자품목규격수량단가금액공급업체용도
" + getmaxstr(sSC) + "" + getmaxstr(sSID) + "" + getmaxstr(s요청) + "" + getmaxstr(s품명) + "" + getmaxstr(s규격) + "" + qty.ToString("N0") + "" + price.ToString("N0") + "" + amt.ToString("N0") + "" + getmaxstr(s공급) + "" + s비고 + "" + getmaxstr(sSTIE) + "" + getmaxstr(s분류) + "" + getmaxstr(sCRCF) + "" + getmaxstr(s수령) + "
      TOTAL{금액}
"); if (sheet != null) { col = 0; sheet.setRow(row, 30); sheet.writeStr(row, col++, "합계", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeNum(row, col++, (int)totalamt, fTitle); sheet.setMerge(row, row, col - 1, col); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); sheet.writeStr(row, col++, "", fTitle); row += 1; } if (book != null) { try { book.save(savefilenamexls); } catch { } } return sb.ToString().Replace("{금액}", totalamt.ToString("N0")); } } public static class DatabaseManager { private static System.Data.SqlClient.SqlConnection getCn() { string cs = Properties.Settings.Default.gwcs; System.Data.SqlClient.SqlConnection cn = new System.Data.SqlClient.SqlConnection(); cn.ConnectionString = cs; return cn; } public static List getEQGroupLiist(string GroupColumn, string table) { List retval = new List(); var cn = getCn(); cn.Open(); var sql = "select {0} from {1} where gcode='" + FCOMMON.info.Login.gcode + "' and isnull({0},'') != '' group by {0} order by {0}"; if (GroupColumn.IndexOf("+") == -1) sql = string.Format(sql, "[" + GroupColumn + "]", table); else sql = string.Format(sql, GroupColumn, table); var cmd = new System.Data.SqlClient.SqlCommand(sql, cn); var rdr = cmd.ExecuteReader(); while (rdr.Read()) { retval.Add(rdr[0].ToString()); } cmd.Dispose(); cn.Close(); cn.Dispose(); return retval; } } }