这是finereport报表软件的导入报表过程:
读取某一路径下的模板cpt文件,并将其转为WorkBook对象,有两种读取报表的
方法:一、直接以文件绝对路径读取;二、先定义报表运行环境,然后从运行环
境中直接读取相对路径下的模板。
1.1 绝对路径读取模板
// 读取模板
File cptfile = new File("C:\\FineReport6.5\\WebReport\WEB-
INF\\reportlets\\gettingstarted.cpt");
TemplateImporter tplimp = new TemplateImporter();
WorkBook workbook = tplimp.generateTemplate(cptfile);
1.2 读取报表运行环境下的模板
//定义报表运行环境,读取环境下的报表
String envPath = " C:\\FineReport6.5\\WebReport \\WEB-INF";
FRContext.setCurrentEnv(new LocalEnv(envPath));
TemplateWorkBook workbook = FRContext.getCurrentEnv
().readTemplate("gettingstarted.cpt");
更多的你可以去官网下载一个设计器,去二次开发文档里面看看。