Package com.fins.gt.export

Examples of com.fins.gt.export.AbstractXlsWriter


    public void setXlsWriter(AbstractXlsWriter writer){
      writers.put("xls", writer);
    }
   
    public AbstractXlsWriter getXlsWriter(){
      AbstractXlsWriter writer=null;
      try {
       writer = (AbstractXlsWriter)writers.get("xls");
      } catch (Exception e) {
        LogHandler.warn(this,e);
      }
View Full Code Here


    public void exportXLS(List data,String[] properiesName, String[] headsName, Class beanClass) throws IOException{
      String fileName=getParameter("exportFileName");
      downloadFile(fileName+".xls");
     
      OutputStream out=getResponse().getOutputStream();
      AbstractXlsWriter xlsw= getXlsWriter();
      xlsw.init();
      xlsw.setOut(out);
      xlsw.setEncoding(getEncoding());
      xlsw.start();
      xlsw.addRow( headsName );
      if (beanClass==null || Map.class.isAssignableFrom(beanClass) ){
        for (int i=0,len=data.size();i<len;i++){
          Map record=(Map)data.get(i);
          xlsw.addRow(BeanUtils.map2Array(record,properiesName));
        }
      }else{
        for (int i=0,len=data.size();i<len;i++){
          Object record= data.get(i);
          xlsw.addRow( BeanUtils.bean2Array(record,properiesName,beanClass) );
        }
      }
     
      xlsw.end();   
      xlsw.close();
    }
View Full Code Here

TOP

Related Classes of com.fins.gt.export.AbstractXlsWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.