http://www.hitkeyboarder.com/doc/jiaocheng/teachDoc/有很多视频的
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);*/
}
}