<%@page import="com.udapsoft.waf.common.web.ibsheet7.IBSheet7TD"%> <%@page import="com.udapsoft.waf.common.web.ibsheet7.IBSheet7TR"%> <%@page import="com.udapsoft.waf.common.web.ibsheet7.IBSheet7Data"%> <%@page import="com.udapsoft.waf.system.HandlerStorage"%> <%@ page import="kr.co.hsnc.common.util.*" %> <%@ page import="kr.co.hsnc.common.sql.*" %> <%@ page import="kr.co.hsnc.common.message.WAFMessage" %> <%@ page contentType="text/html; charset=utf-8" %> <% ctx.init(request, response); HandlerStorage storage = ctx.getHandlerStorage(); String msg = storage.getMessage(); ValueObject params = storage.getParams(); WAFMessage wafMessage = WAFMessage.getInstance(); wafMessage.setLocale(ctx.getLocale()); boolean success = storage.getSuccess(); IBSheet7Data sheetData = storage.getIBSheet7Data(); %> <% if( !success ) { %> ]]> ]]> <% } else { %> <% if( sheetData != null ) { %> <% if( sheetData.getAttribute("TOTAL").equals("") ) { %> " <% } %> <% ValueObject dataAttr = sheetData.getAttributes(); %> <% dataAttr.remove("TOTAL"); %> <% for( int attrIndex = 0 ; attrIndex < dataAttr.size() ; attrIndex++ ) { %> <%= dataAttr.getKey(attrIndex) %>="<%= dataAttr.get(attrIndex) %>" <% } %> <%= ">" %> <% for( int i = 0 ; i < sheetData.getRowSetSize() ; i++ ) { %> <%IBSheet7TR sheetTR = sheetData.sheetTR;%> <% ValueObject trAttr = sheetTR.getAttributes(); %> <% int columnSize = sheetTR.getSheetTDSize(); %> <%= trAttr.getKey(attrIndex) %>="<%= trAttr.get(attrIndex) %>" <% } %> <%= ">" %> <% for( int j = 0 ; j < columnSize ; j++ ) { %> <% ValueObject tdAttr = sheetTD.getAttributes(); %> <% for( int attrIndex = 0 ; attrIndex < tdAttr.size() ; attrIndex++ ) { %> <%= tdAttr.getKey(attrIndex) %>="<%= tdAttr.get(attrIndex) %>" <% } %> <% if( sheetTD.isBlankValue ) { %> <%= ">" %> <% } else { %> <% RowSet rowSet = sheetData.getRowSet(sheetTD.rowSetKey); %> <% if( rowSet != null ) { %> <% String temp = ""; if( sheetTD.rowSetColumnIndex < rowSet.getColumnSize() ) { temp = rowSet.getRow(i).get(sheetTD.rowSetColumnIndex); if( !"".equals(sheetTD.currencyType) ) { double amount = rowSet.getRow(i).getDouble(sheetTD.rowSetColumnIndex); if( sheetTD.currencyType.equalsIgnoreCase("KRW") ) temp = formatCurrency(amount, "###,###", "₩"); else if( sheetTD.currencyType.equalsIgnoreCase("USD") ) temp = formatCurrency(amount, "###,##0,##", "$"); else if( sheetTD.currencyType.equalsIgnoreCase("EUR") ) temp = formatCurrency(amount, "###,##0,##", ""); else if( sheetTD.currencyType.equalsIgnoreCase("JPY") ) temp = formatCurrency(amount, "###,##0,##", ""); else if( sheetTD.currencyType.equalsIgnoreCase("SAR") ) temp = formatCurrency(amount, "###,##0,##", ""); } } else { temp = sheetTD.rowSetColumnIndex + " column is not exist(rowset key name: " + sheetTD.rowSetKey + ", rowset column size:" + rowSet.getColumnSize() + ", column index:" + sheetTD.rowSetColumnIndex + ")"; } %> <%= ">" %>]]> <% } else { %> <%= ">" %> <% } %> <% } %> <% } %> <% } %> <% } %> <% } %> <%! private static String formatCurrency(double amount, String pattern, String currencySymbol) { java.text.DecimalFormatSymbols symbol = new java.text.DecimalFormatSymbols(); symbol.setCurrencySymbol(currencySymbol.trim()); java.text.DecimalFormat df = new java.text.DecimalFormat(pattern, symbol); return currencySymbol + df.format(amount); } %>