Flex 的学习网站

http://www.hitkeyboarder.com/doc/jiaocheng/teachDoc/有很多视频的

 

http://www.hitkeyboarder.com/plus/search.php?kwtype=1&keyword=%C6%A4%B7%F4&searchtype=title&x=18&y=14皮肤的学习FLEX4

 

 

http://resources.esri.com/arcgisserver/apis/flex/index.cfm?fa=codeGalleryDetails&scriptID=16838arcserver

adobe 网站http://opensource.adobe.com/wiki/display/site/Home

 

flex + arcserver

48394225群,有esri的技术支持



package cn.org.zx.shcpa.def;
import java.io.BufferedWriter;  
import java.io.File;  
import java.io.FileNotFoundException;  
import java.io.FileOutputStream;  
import java.io.IOException;  
import java.io.OutputStream;
import java.io.OutputStreamWriter;  
import java.io.UnsupportedEncodingException;
import java.io.Writer;  
import java.math.BigDecimal;
import java.util.ArrayList;  
import java.util.Date;
import java.util.HashMap;  
import java.util.List;  
import java.util.Map;  


import cn.org.zx.common.commutils.DateUtils;
import cn.org.zx.common.dao.DBAccess;
  
import freemarker.template.Configuration;  
import freemarker.template.Template;  
import freemarker.template.TemplateException; 
public class ExportUtil {
   private Configuration configuration = null;  
     
   public ExportUtil(){  
       configuration = new Configuration();  
       configuration.setDefaultEncoding("UTF-8");  
   }  
     
   public static void main(String[] args) throws UnsupportedEncodingException {
    String ss=" ??□  ygggg   □   ■ □√";
    BigDecimal decimal=new BigDecimal(16);
    //decimal.
    ExportUtil test = new ExportUtil();  
       test.createWord();  
       /*try{
String path=System.getProperty("user.dir");
System.out.println("****"+path);
//path=path.substring(0, path.length()-3)+"webapps/tongshi/upload/export/";
path=path+"/webapps/tongshi/upload/export/";
OutputStream output=new FileOutputStream(path+fileName+".xls");
output.flush();
workbook.write(output);
File file=new File(path+fileName+".xls");
String Date=DateUtils.dateToString(new Date(file.lastModified()),0);
String size=file.length()/1024+"k";
String sql="insert into ts_xlsexport(ts_xlsname,ts_xlsdate,ts_xlssize) values ('"+fileName+".xls','"+Date+"','"+size+"')";

DBAccess.update(sql);
response.sendRedirect("/upload/export/"+fileName+".xls");

} catch (Exception e) {
e.printStackTrace();
}*/
   }  
     
   public void createWord() throws UnsupportedEncodingException{  
       Map<String,Object> dataMap=new HashMap<String,Object>();  
       //getData(dataMap);  
       getWordData(dataMap);
       configuration.setClassForTemplateLoading(this.getClass(), "/com/test");  //FTL文件所存在的位置  
       Template t=null;  
       try {  
           //t = configuration.getTemplate("personalmodel.ftl"); //文件名 
        //t = configuration.getTemplate("cheliangzichan.ftl"); //文件名 
        t = configuration.getTemplate("zm1.ftl"); //文件名 
       } catch (IOException e) {  
           e.printStackTrace();  
       }  
       //File outFile = new File("C:/outFilessa"+Math.random()*10000+".xls");  //生成文件的路径
       File outFile = new File("C:/outFilessa"+Math.random()*10000+".doc");  //生成文件的路径
       Writer out = null;  
       try {  
           out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile),"utf-8"));  
       } catch (FileNotFoundException e1) {  
           e1.printStackTrace();  
       }  
          
       try {  
           t.process(dataMap, out);  
       } catch (TemplateException e) {  
           e.printStackTrace();  
       } catch (IOException e) {  
           e.printStackTrace();  
       }  
   } 
   private void getWordData(Map<String, Object> dataMap) {  
    dataMap.put("app01", " 万科东郡");
       /*dataMap.put("app01", " 万科东郡");  
       dataMap.put("app02", "qwe");
       dataMap.put("app03", " ht001");  
       dataMap.put("app04", "50000");*/
    /*for(int i=1;i<=34;i++){
    if(i<10)
    dataMap.put("app0"+i, "内容"+i);
    else
    dataMap.put("app"+i, "内容"+i);
    }*/
   
    /* dataMap.put("guaranteename", "柯德");
    dataMap.put("guaranteecardnum", "111111111111111111");
    dataMap.put("guaranteetel", "021-62117728");
    dataMap.put("guaranteephone", "13811111111");*/
   }
   //这里赋值的时候需要注意,xml中需要的数据你必须提供给它,不然会报找不到某元素错的.
   private void getData(Map<String, Object> dataMap) {  
       dataMap.put("app001", " □本展厅客户  □二级网店客户");  
       dataMap.put("app003", "2012");  
       /*dataMap.put("app003", "2");  
       dataMap.put("app004", "13");  
       dataMap.put("app005", "鑫");  
       dataMap.put("app006", "xxxxxxxxxxxxx");  
       dataMap.put("app007", "文涛");
       dataMap.put("app008", "文涛");  
       dataMap.put("app009", "文涛");  
       dataMap.put("app010", "文涛");  
       
       dataMap.put("app011", "文涛");  
       dataMap.put("app012", "文涛");  
       dataMap.put("app013", "文涛");  
       
       dataMap.put("app014", "文涛");  
       dataMap.put("app015", "文涛");  
       dataMap.put("app016", "文涛");  
       dataMap.put("app017", "文涛");  
       
       dataMap.put("app018", "文涛");  
       dataMap.put("app019", "文涛"); 
       dataMap.put("app020", "文涛");*/ 
//      dataMap.put("number", 1);  
//      dataMap.put("content", "内容"+2);  
         
       /*List<Map<String,Object>> list = new ArrayList<Map<String,Object>>();  
       for (int i = 0; i < 10; i++) {  
           Map<String,Object> map = new HashMap<String,Object>();  
           map.put("number", i);  
           map.put("content", "内容"+i);  
           list.add(map);  
       }  
         
         
       dataMap.put("list", list);*/  
   }  
}  



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值