本站首页    管理页面    写新日志    退出

The Neurotic Fishbowl

[Java报表软件—技术知识]FineReport6.5 Java报表软件离线填写报表
FineReport——报表技术领跑者 发表于 2010/5/20 9:03:14

    离线填报示例 本例以一个实例来展现FineReport  Java报表软件离线填写报表功能。 下图为一个雇员统计表: 500)this.width=500'>     FineReport6.5 Java报表软件设计器里的报表设计如下图: 500)this.width=500'>   FineReport6.5 Java报表软件模板中报表填报属性如下: 500)this.width=500'>  保存该模板到C:\FineReport6.2\WebReport\WEB-INF\reportlets目录下,命名为WorkBook1.cpt。 依次点击FineReport文件à输出àExcel格式à原样导出,得下图的.xls文件: 500)this.width=500'>     填写雇员信息如下: 500)this.width=500'>     将其另存,路径为C:\WorkSheet1.xls.。 运行如下导入程序即可将数据导入数据库中,注意此处要特别留心程序中几个路径是否正确。 import java.io.FileInputStream; import java.util.HashMap;   import com.fr.base.FRContext;   import com.fr.base.dav.LocalEnv; import com.fr.report.ReportTemplate; import com.fr.report.io.ExcelImporter;   public class TestUtils {        public void exe() {               // 配置系统运行环境,可以localEnv remoteEnv               com.fr.base.dav.LocalEnv env = new LocalEnv("C:\\FineReport6.5\\WebReport\\WEB-INF");               try {                      // 设置                      FRContext.setCurrentEnv(env);                      // 读取模板                      ReportTemplate tpl = env.readTemplate("WorkBook1.cpt");                      // 读取Excel文件                      FileInputStream file = new FileInputStream("C:\\WorkSheet1.xls");                      // 调用方法,具体如下                      ExcelImporter.importExcel(tpl, new HashMap(), file);               } catch (Exception e) {                      // TODO Auto-generated catch block                      e.printStackTrace();               }                      }        public static void main(String[] args)        {               TestUtils testUtils = new TestUtils();               testUtils.exe();        } } 查看数据库中数据见下图: 500)this.width=500'>     至此离线填报成功。

阅读全文(1271) | 回复(0) | 编辑 | 精华

 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)

 
 



The Neurotic Fishbowl

.: 公告

本博客提供详细的java报表软件的制作过程,发布java报表软件的版本更新信息,并适时对国内主流报表软件进行功能比较。


Bloginess

«August 2025»
12
3456789
10111213141516
17181920212223
24252627282930
31

.: 我的分类(专题)

首页(357)
Java报表软件—制作笔记(54)
Java报表软件—功能比较(43)
Java报表软件—使用心得(21)
Java报表软件—行业动态(54)
Java报表软件—新闻资讯(48)
Java报表软件—技术知识(49)
Java报表软件—问题解析(2)


In the Bowl

.: 最新日志

如何对报表的参数控件赋值
java报表工具FineReport常见
报表怎么做 FineReport连接池原
报表怎么做FineReport数据连接之
报表模板之报表设计
报表模板之报表设计


.: 最新回复

回复:报表参数
好好学习,
好好学习,天天向上。买双 air jor
回复:理解FineReport缓存系列2
回复:理解FineReport缓存系列2


The Fishkeeper
blog名称:Java报表软件
日志总数:357
评论数量:69
留言数量:0
访问次数:1212176
建立时间:2006年4月16日



Text Me

.: 留言板

签写新留言

需要你的帮助


Other Fish in the Sea

.: 链接

报表开发工具  html5图表java报表开发工具




站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.141 second(s), page refreshed 144786145 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号