1.怎么用java poi生成word表格
rt java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class XwpfTUtil {
/*String filePath = "/sta.docx";
InputStream is;
XWPFDocument doc;
Mapparams = new HashMap();
{
params.put("${name}", "xxx");
params.put("${sex}", "男");
params.put("${political}", "共青团员");
params.put("${place}", "sssss");
params.put("${classes}", "3102");
params.put("${id}", "213123123");
params.put("${qq}", "213123");
params.put("${tel}", "312313213");
params.put("${oldJob}", "sadasd");
params.put("${swap}", "是");
params.put("${first}", "asdasd");
params.put("${second}", "综合事务部");
params.put("${award}", "asda");
params.put("${achievement}", "完成科协网站的开发");
params.put("${advice}", "没有建议");
2.poi中,如何向Word文档里添加表格
//创建一个表格
XWPFTable table = doc.createTable(4,2);
table.setCellMargins(50, 0, 50,3000);//top, left, bottom, right
// table.setInsideHBorder(XWPFBorderType.NONE, 0, 0, "");//去除单元格间的横线
table.getRow(0).getCell(0).setText("字段一:");
table.getRow(0).getCell(1).setText("字段二:");
table.getRow(1).getCell(0).setText("字段三:");
table.getRow(1).getCell(1).setText("字段四:");
转载请注明出处51数据库 » javapoi替换word表格