java code
try
{
//生成Chart数据
ArrayList<ChartBean> data = new ArrayList<ChartBean>(5);
data.add(new ChartBean("小学", 5));
data.add(new ChartBean("初中", 10));
data.add(new ChartBean("高中", 15));
data.add(new ChartBean("本科", 20));
data.add(new ChartBean("研究生",15)); JRDataSource dataSource = new JRBeanCollectionDataSource(data); // 获取报表模板文件
String root_path = this.getServlet().getServletContext().getRealPath("/");
root_path = root_path.replace('\\', '/');
String reportFilePath = root_path + "WEB-INF/classes/com/myapp/ireport/report_2.jasper" ;
System.out.println( "jasper file is " + reportFilePath);java code
try
{
//生成Chart数据
ArrayList<ChartBean> data = new ArrayList<ChartBean>(5);
data.add(new ChartBean("小学", 5));
data.add(new ChartBean("初中", 10));
data.add(new ChartBean("高中", 15));
data.add(new ChartBean("本科", 20));
data.add(new ChartBean("研究生",15)); JRDataSource dataSource = new JRBeanCollectionDataSource(data); // 获取报表模板文件
String root_path = this.getServlet().getServletContext().getRealPath("/");
root_path = root_path.replace('\\', '/');
String reportFilePath = root_path + "WEB-INF/classes/com/myapp/ireport/report_2.jasper" ;
System.out.println( "jasper file is " + reportFilePath);java code
解决方案 »
- 公司内网如何做规章制度的展示
- get方式穿中文
- 麻烦帮忙解释一下执行结果
- MyEclipse 设置webService的WSDL时,出现an error occurred while completing process -java.lang.reflect.InvocationTargetException
- 紧急求助:我的BMT stateless session bean,bean class里面的方法调用存储过程,可是为什么总是提示找不到datasource
- 求大神帮忙servlet接收上传图片的问题
- 给个思路······
- 有必要报培训班吗
- 浏览器显示空白!!???
- JAVA的activemq在分布式系统上,多个provider中,队列是共享的吗
- 准备用weblogic开发,哪个版本的好
- web项目 超级管理员密码应该放在哪里
{
//生成Chart数据
ArrayList <ChartBean> data = new ArrayList <ChartBean>(5);
data.add(new ChartBean("小学", 5));
data.add(new ChartBean("初中", 10));
data.add(new ChartBean("高中", 15));
data.add(new ChartBean("本科", 20));
data.add(new C…
[/java code]