Map params = new HashMap();
params.put("chartList",getChartListData());
娱乐世界注册入口Print jasperPrint = 娱乐世界注册入口FillManager.fillReport(new FileInputStream(templateFile), params,dataSource);
娱乐世界注册入口ExportManager.exportReportToPdfStream(jasperPrint,new FileOutputStream("d://用户列表数据.pdf"));
}
public static List<People> getListData(){
List<People> peopleList = new ArrayList<>();
peopleList.add(new People(1L, "大一","13800000001","北京市","2001-01-01"));
peopleList.add(new People(2L, "不二","13800000002","河北省","2002-01-02"));
peopleList.add(new People(3L, "张三","13800000003","河北省","2003-03-03"));
peopleList.add(new People(4L, "李四","13800000004","河北省","2004-02-04"));
peopleList.add(new People(5L, "王五","13800000005","河北省","2005-03-05"));
peopleList.add(new People(6L, "赵六","13800000006","河北省","2006-04-06"));
peopleList.add(new People(7L, "沈七","13800000007","河北省","2007-06-07"));
peopleList.add(new People(8L, "酒八","13800000008","河北省","2008-07-08"));
peopleList.add(new People(9L, "第九","13800000009","山东省","2009-03-09"));
peopleList.add(new People(10L, "石十","13800000010","山东省","2010-07-10"));
peopleList.add(new People(11L, "肖十一","13800000011", "山东省","2011-12-11"));
peopleList.add(new People(12L, "星十二","13800000012", "山东省","2012-05-12"));
peopleList.add(new People(13L, "钗十三","13800000013", "山东省","2013-06-13"));
peopleList.add(new People(14L, "贾十四","13800000014", "山东省","2014-06-14"));
peopleList.add(new People(15L, "甄世武","13800000015", "山东省","2015-06-15"));
return peopleList;
}
public static List<PeopleCount> getChartListData(){
List<PeopleCount> peopleCountList = new ArrayList<>();
peopleCountList.add(new PeopleCount("北京市",100));
peopleCountList.add(new PeopleCount("河北省",200));
peopleCountList.add(new PeopleCount("山东省",220));
peopleCountList.add(new PeopleCount("河南省",230));
return peopleCountList;
}
}
效果如下:
猜你喜欢
什么是枚举?没有枚举之前,怎么做的?