3e7e74501cdc57a8f1b372a99e89f1fada40f08c.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?xml-stylesheet href="../../css/body.css" type="text/css" ?>
  3. <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2002/01/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
  4. <xhtml:head>
  5. <xhtml:title>Untitle</xhtml:title>
  6. <model id="model1">
  7. <instance id="instance1">
  8. <root xmlns="">
  9. <formData>
  10. <LgCd/>
  11. </formData>
  12. <LovData>
  13. <LgCd/>
  14. </LovData>
  15. <gridData/>
  16. <reqData/>
  17. <resData/>
  18. <headLine>
  19. <ListResult_1_VO>
  20. <ListResult_1_Row>
  21. <LG_CD>热连轧成品出库班报表</LG_CD>
  22. <SM_CD/>
  23. <LG_NM/>
  24. <SM_CFNM/>
  25. <SM_CSNM/>
  26. <SM_EFNM/>
  27. <SM_ESNM/>
  28. <BIZ_CLF/>
  29. <CD_SEQ/>
  30. <USED_YN/>
  31. <CD_DESC/>
  32. <CD_LEN/>
  33. <MOD_ID/>
  34. <MOD_DATE/>
  35. </ListResult_1_Row>
  36. <ListResult_1_Row>
  37. <LG_CD>日期</LG_CD>
  38. <SM_CD/>
  39. <LG_NM/>
  40. <SM_CFNM/>
  41. <SM_CSNM/>
  42. <SM_EFNM/>
  43. <SM_ESNM/>
  44. <BIZ_CLF/>
  45. <CD_SEQ/>
  46. <USED_YN/>
  47. <CD_DESC/>
  48. <CD_LEN/>
  49. <MOD_ID/>
  50. <MOD_DATE>
  51. <![CDATA[班组 & 班次]]>
  52. </MOD_DATE>
  53. </ListResult_1_Row>
  54. </ListResult_1_VO>
  55. </headLine>
  56. <subTitle>
  57. <ListResult_1_VO>
  58. <ListResult_1_Row>
  59. <LG_CD>大分类代码</LG_CD>
  60. <SM_CD>小分类代码</SM_CD>
  61. <LG_NM>大分类名</LG_NM>
  62. <SM_CFNM>小分类名(中文)</SM_CFNM>
  63. <SM_CSNM>小分类略称(中文)</SM_CSNM>
  64. <SM_EFNM>小分类名(英文)</SM_EFNM>
  65. <SM_ESNM>小分类略称(英文)</SM_ESNM>
  66. <BIZ_CLF>业务领域区分</BIZ_CLF>
  67. <CD_SEQ>标示顺序</CD_SEQ>
  68. <USED_YN>使用与否</USED_YN>
  69. <CD_DESC>代码说明</CD_DESC>
  70. <CD_LEN>使用代码长度</CD_LEN>
  71. <MOD_ID>最终修改人</MOD_ID>
  72. <MOD_DATE>最终修改时间</MOD_DATE>
  73. </ListResult_1_Row>
  74. </ListResult_1_VO>
  75. </subTitle>
  76. </root>
  77. </instance>
  78. </model>
  79. <script type="javascript" src="../../js/boaCommon.js"/>
  80. <script type="javascript" src="../../js/boaMsg.js"/>
  81. <script type="javascript" src="../../js/mesCommon.js"/>
  82. <script type="javascript" src="../../js/dCommon.js"/>
  83. <script type="javascript" ev:event="xforms-ready">
  84. <![CDATA[
  85. commSendReq("/root/formData");
  86. commSubmit("ExcelPrint-service" ,"success" ,"glueAction.do" );
  87. errorMessage();
  88. // The first added "ALL" in LgCd LOV
  89. model.makeValue("/root/LOVData/LgCd/LOVResult_1_Row[1]/LgNm" , "(ALL)" );
  90. model.makeValue("/root/LOVData/LgCd/LOVResult_1_Row[1]/LgCd" , "%" );
  91. var iRows = model.getXPathValue("count(/root/resData/LOVResult_1_VO/LOVResult_1_Row)");
  92. for( var i = 1; i <= iRows; i++ ) {
  93. model.makeValue("/root/LOVData/LgCd/LOVResult_1_Row["+ (i + 1) +"]/LgNm" , model.getValue("/root/resData/LOVResult_1_VO/LOVResult_1_Row["+ i +"]/LG_NM"));
  94. model.makeValue("/root/LOVData/LgCd/LOVResult_1_Row["+ (i + 1) +"]/LgCd" , model.getValue("/root/resData/LOVResult_1_VO/LOVResult_1_Row["+ i +"]/LG_CD"));
  95. }
  96. model.refresh();
  97. LgCd.select(0);
  98. ]]>
  99. </script>
  100. <script type="javascript">
  101. <![CDATA[
  102. function find() {
  103. commSendReq("/root/formData");
  104. commSubmit("ExcelPrint-service" ,"find" ,"glueAction.do" );
  105. //Populate HeadLine Information
  106. commAppendData ("/root/gridData/ListResult_1_VO" ,"/root/headLine/ListResult_1_VO" );
  107. //Populate SubTitle Information
  108. var iSubTitRows = Number(model.getXPathValue("count(/root/subTitle/ListResult_1_VO)") );
  109. for(var i = 1; i <= iSubTitRows ; i++) {
  110. model.duplicate("/root/gridData/ListResult_1_VO" ,"/root/subTitle/ListResult_1_VO/ListResult_1_Row["+ i +"]" );
  111. }
  112. //Populate Query-Results Information
  113. var iQueryRows = Number(model.getXPathValue("count(/root/resData/ListResult_1_VO/ListResult_1_Row)" ));
  114. for(var i = 1; i <= iQueryRows ; i++) {
  115. model.duplicate("/root/gridData/ListResult_1_VO" ,"/root/resData/ListResult_1_VO/ListResult_1_Row["+ i +"]" );
  116. }
  117. model.refresh();
  118. //Hidden TITLE Information
  119. var iHiddenRows = Number(model.getXPathValue("count(/root/headLine/ListResult_1_VO/ListResult_1_Row)")) + iSubTitRows + (dg1.fixedRows - 1);
  120. for(var i = dg1.fixedRows; i <= iHiddenRows ; i++) {
  121. dg1.rowHidden(i) = true;
  122. }
  123. dg1.isSelected(iHiddenRows + 1) = true;
  124. }
  125. function saveExcelScript(sDGridName, sExcelSheetName, saveType) {
  126. var sExcelName = window.fileDialog( "save", "", false, "SaveFileName", "xls", "Excel Files(*.xls)|*.xls" );
  127. if ( sExcelName == "" ) {
  128. return;
  129. }
  130. // var sCSVName = "C:\\TFSmartUpdater\\" + sExcelName.lastIndexOf(".") +".csv";
  131. var sCSVName = sExcelName +".csv";
  132. // alert("sExcelName = ["+ sExcelName +"]\nsCSVName = ["+ sCSVName + "]");
  133. eval(sDGridName).saveText(sCSVName, "\n", ",", '\:', true); //DataGrid의 내용을 CSV파일로 생성
  134. ObjTFExcel.launchNewInstance(0); //Execute EXCEL
  135. ObjTFExcel.createWorkbook(); //Create new Workbook(for example:Sheet1,Sheet2,Sheet3) -- createWorkBook(Excel-TemplateFile)
  136. ObjTFExcel.loadCSV(sCSVName); //Loading Contents, from CSV to Excel
  137. //Setting up EXCEL Layout.
  138. var nRows = sDGridName.rows - 1;
  139. var nCols = sDGridName.cols;
  140. //All of the range
  141. ObjTFExcel.fontcolor( 01, 01, nRows, nCols ) = "#000000" ;
  142. ObjTFExcel.font ( 01, 01, nRows, nCols ) = "SimSun" ;
  143. //Header
  144. //Line 1 : Sheet Title
  145. ObjTFExcel.rowheight( 01 ) = 30 ;
  146. ObjTFExcel.bold ( 01, 01, 01, nCols ) = true ;
  147. ObjTFExcel.fontsize ( 01, 01, 01, nCols ) = 14 ;
  148. ObjTFExcel.underline( 01, 01, 01, nCols ) = 3 ;
  149. ObjTFExcel.halign ( 01, 01, 01, nCols ) ="center" ;
  150. ObjTFExcel.valign ( 01, 01, 01, nCols ) ="top" ;
  151. ObjTFExcel.mergeCell( 01, 01, 01, nCols ) ;
  152. // ObjTFExcel.colwidth ( 01 ) = 100 ;
  153. //Line 2 : Date
  154. ObjTFExcel.rowheight( 02 ) = 18 ;
  155. ObjTFExcel.bold ( 02, 01, 02, 01 ) = true ;
  156. ObjTFExcel.fontsize ( 02, 01, 02, 01 ) = 9 ;
  157. ObjTFExcel.underline( 02, 01, 02, 01 ) = 0 ;
  158. ObjTFExcel.halign ( 02, 01, 02, 01 ) ="left" ;
  159. ObjTFExcel.valign ( 02, 01, 02, 01 ) ="middle" ;
  160. ObjTFExcel.mergeCell( 02, 01, 02, 03 ) ;
  161. // ObjTFExcel.colwidth ( 01 ) = 100 ;
  162. //Line 2 : Work-Group & Work-Part
  163. ObjTFExcel.rowHeight( 02 ) = 18 ;
  164. ObjTFExcel.bold ( 02, nCols - 2, 02, nCols ) = true ;
  165. ObjTFExcel.fontsize ( 02, nCols - 2, 02, nCols ) = 9 ;
  166. ObjTFExcel.underline( 02, nCols - 2, 02, nCols ) = 0 ;
  167. ObjTFExcel.halign ( 02, nCols - 2, 02, nCols ) ="right" ;
  168. ObjTFExcel.valign ( 02, nCols - 2, 02, nCols ) ="middle" ;
  169. ObjTFExcel.mergeCell( 02, nCols - 2, 02, nCols ) ;
  170. // ObjTFExcel.colwidth ( 01 ) = 100 ;
  171. //Query-Results Data
  172. var iRow = 3; // Header Line + 1;
  173. // ObjTFExcel.cellBgColor (iRow, 01, iRow , nCols ) = "#EEEEEE"; // Undefined...
  174. ObjTFExcel.setBorderColor(iRow, 01, nRows, nCols, "#000000");
  175. for(var i = 3; i <= nRows; i++ ) {
  176. ObjTFExcel.rowHeight( i ) = 18;
  177. }
  178. ObjTFExcel.bold (iRow, 01, nRows, nCols ) = false ;
  179. ObjTFExcel.fontsize (iRow, 01, nRows, nCols ) = 9 ;
  180. ObjTFExcel.underline(iRow, 01, nRows, nCols ) = 0 ;
  181. ObjTFExcel.valign (iRow, 01, nRows, nCols ) ="middle" ;
  182. ObjTFExcel.halign (iRow, 01, nRows, 01 ) ="center" ; //大分类代码
  183. ObjTFExcel.colwidth ( 01 ) = 12 ;
  184. ObjTFExcel.halign (iRow, 02, nRows, 02 ) ="left" ; //小分类代码
  185. ObjTFExcel.colwidth ( 02 ) = 12 ;
  186. ObjTFExcel.halign (iRow, 03, nRows, 03 ) ="left" ; //大分类名
  187. ObjTFExcel.colwidth ( 03 ) = 20 ;
  188. ObjTFExcel.halign (iRow, 04, nRows, 04 ) ="left" ; //小分类名(中文)
  189. ObjTFExcel.colwidth ( 04 ) = 20 ;
  190. ObjTFExcel.halign (iRow, 05, nRows, 05 ) ="left" ; //小分类略称(中文)
  191. ObjTFExcel.colwidth ( 05 ) = 20 ;
  192. ObjTFExcel.halign (iRow, 06, nRows, 06 ) ="left" ; //小分类名(英文)
  193. ObjTFExcel.colwidth ( 06 ) = 20 ;
  194. ObjTFExcel.halign (iRow, 07, nRows, 07 ) ="left" ; //小分类略称(英文)
  195. ObjTFExcel.colwidth ( 07 ) = 20 ;
  196. ObjTFExcel.halign (iRow, 08, nRows, 08 ) ="center" ; //业务领域区分
  197. ObjTFExcel.colwidth ( 08 ) = 12 ;
  198. ObjTFExcel.halign (iRow, 09, nRows, 09 ) ="right" ; //标示顺序
  199. ObjTFExcel.colwidth ( 09 ) = 10 ;
  200. ObjTFExcel.halign (iRow, 10, nRows, 10 ) ="center" ; //使用与否
  201. ObjTFExcel.colwidth ( 10 ) = 10 ;
  202. ObjTFExcel.halign (iRow, 11, nRows, 11 ) ="left" ; //代码说明
  203. ObjTFExcel.colwidth ( 11 ) = 20 ;
  204. ObjTFExcel.halign (iRow, 12, nRows, 12 ) ="right" ; //使用代码长度
  205. ObjTFExcel.colwidth ( 12 ) = 15 ;
  206. ObjTFExcel.halign (iRow, 13, nRows, 13 ) ="left" ; //最终修改人
  207. ObjTFExcel.colwidth ( 13 ) = 12 ;
  208. ObjTFExcel.halign (iRow, 14, nRows, 14 ) ="center" ; //最终修改时间
  209. ObjTFExcel.colwidth ( 14 ) = 20 ;
  210. ObjTFExcel.setFormat(iRow, 14, nRows, 14, "yyyy\"-\"mm\"-\"dd\"\" hh\":\"mm\":\"ss\"\";@");
  211. ObjTFExcel.sheetName(1) = sExcelSheetName;
  212. ObjTFExcel.save(sExcelName); //Saving EXCEL
  213. ObjTFExcel.close(); //Closing EXCEL. (You must be closed EXCEL !!!)
  214. window.exec("EXCEL.EXE", sExcelName); //Openning EXCEL
  215. }
  216. ]]>
  217. </script>
  218. </xhtml:head>
  219. <xhtml:body>
  220. <caption id="caption1" style="left:10px; top:10px; width:290px; height:25px; font-weight:bold; color:#0000ff; vertical-align:middle; ">※. ExcelPrint Example</caption>
  221. <object id="ObjTFExcel" clsid="{fe8d1001-6a9d-424d-ae2a-301493bb12da}" style="left:320px; top:10px; width:155px; height:25px; "/>
  222. <button id="button1" style="left:860px; top:15px; width:90px; height:21px; background-color:#c0c0c0; ">
  223. <caption>EXCEL</caption>
  224. <script type="javascript" ev:event="DOMActivate">
  225. <![CDATA[
  226. saveExcelScript(dg1, "Sheet1");
  227. ]]>
  228. </script>
  229. </button>
  230. <line id="line1" style="x1:300px; y1:34px; x2:10px; y2:34px; border-color:#0000ff; "/>
  231. <datagrid id="dg1" nodeset="/root/gridData/ListResult_1_VO/ListResult_1_Row" caption="LG_CD^SM_CD^LG_NM^SM_CFNM^SM_CSNM^SM_EFNM^SM_ESNM^BIZ_CLF^CD_SEQ^USED_YN^CD_DESC^CD_LEN^MOD_ID^MOD_DATE|LG_CD^SM_CD^LG_NM^SM_CFNM^SM_CSNM^SM_EFNM^SM_ESNM^BIZ_CLF^CD_SEQ^USED_YN^CD_DESC^CD_LEN^MOD_ID^MOD_DATE" colsep="^" colwidth="60, 60, 100, 100, 100, 100, 100, 65, 70, 65, 100, 65, 70, 120" mergecellsfixedrows="bycolrec" rowsep="|" style="left:10px; top:50px; width:940px; height:450px; ">
  232. <col editable="false" ref="LG_CD" type="input" style="text-align:left; "/>
  233. <col editable="false" ref="SM_CD" type="input" style="text-align:left; "/>
  234. <col editable="false" ref="LG_NM" type="input" style="text-align:left; "/>
  235. <col editable="false" ref="SM_CFNM" type="input" style="text-align:left; "/>
  236. <col editable="false" ref="SM_CSNM" type="input" style="text-align:left; "/>
  237. <col editable="false" ref="SM_EFNM" type="input" style="text-align:left; "/>
  238. <col editable="false" ref="SM_ESNM" type="input" style="text-align:left; "/>
  239. <col editable="false" ref="BIZ_CLF" type="input" style="text-align:center; "/>
  240. <col editable="false" ref="CD_SEQ" type="input" style="text-align:right; "/>
  241. <col editable="false" ref="USED_YN" type="input" style="text-align:center; "/>
  242. <col editable="false" ref="CD_DESC" type="input" style="text-align:left; "/>
  243. <col editable="false" ref="CD_LEN" type="input" style="text-align:right; "/>
  244. <col editable="false" ref="MOD_ID" type="input" style="text-align:left; "/>
  245. <col editable="false" ref="MOD_DATE" type="input" style="text-align:center; "/>
  246. </datagrid>
  247. <button id="button2" style="left:765px; top:15px; width:90px; height:21px; background-color:#c0c0c0; ">
  248. <caption>FIND</caption>
  249. <script type="javascript" ev:event="DOMActivate">
  250. <![CDATA[
  251. find();
  252. ]]>
  253. </script>
  254. </button>
  255. <select1 id="LgCd" ref="/root/formData/LgCd" appearance="minimal" style="left:495px; top:15px; width:165px; height:21px; ">
  256. <choices>
  257. <itemset nodeset="/root/LOVData/LgCd/LOVResult_1_Row">
  258. <label ref="LgNm"/>
  259. <value ref="LgCd"/>
  260. </itemset>
  261. </choices>
  262. </select1>
  263. <button id="button3" style="left:860px; top:15px; width:90px; height:21px; background-color:#c0c0c0; ">
  264. <caption>EXCEL</caption>
  265. <script type="javascript" ev:event="DOMActivate">
  266. <![CDATA[
  267. saveExcelScript(dg1, "Sheet1");
  268. ]]>
  269. </script>
  270. </button>
  271. </xhtml:body>
  272. </xhtml:html>