本帖最后由 zx751117 于 2016-7-26 16:19 编辑 java后台把fineRepo图表导出pdf格式时发生错误! 参照例子:http://www.finereporthelp.com/help/15/1/1/folder.html API导出表格表时不会发生错误,API导出图形表时就会发生错误!!!!!!!! FineReport的BUG 错误: 警告: com.fr.plugin.chart.locale.VanChartLocaleFinder [月 7 25 19:31:07 JST 2016] 警告: com.fr.plugin.chart.VanChartsBaseJavaScript [月 7 25 19:31:07 JST 2016] 警告: com.fr.plugin.chart.locale.VanChartLocaleFinder [月 7 25 19:31:07 JST 2016] 警告: com.fr.plugin.chart.VanChartsBaseJavaScript [月 7 25 19:31:07 JST 2016] java.lang.RuntimeException: Class not found : CC at com.fr.stable.bridge.StableFactory.createXmlObject(Unknown Source) at com.fr.xml.ReportXMLUtils.tokenizeDetailObject(Unknown Source) at com.fr.xml.ReportXMLUtils.access$000(Unknown Source) at com.fr.xml.ReportXMLUtils$ReportObjectTokenizer.tokenizerObject(Unknown Source) at com.fr.general.xml.GeneralXMLTools.readObject(Unknown Source) at com.fr.report.cell.FloatElement.readXML(Unknown Source) at com.fr.stable.xml.XMLableReader.readXMLObject(Unknown Source) at com.fr.xml.ReportXMLUtils$4.readXML(Unknown Source) at com.fr.stable.xml.XMLableReader.readXMLObject(Unknown Source) at com.fr.xml.ReportXMLUtils.readFloatElementList(Unknown Source) at com.fr.report.elementcase.AbstractElementCase.readXML(Unknown Source) at com.fr.report.report.AbstractECReport.readXML(Unknown Source) at com.fr.report.worksheet.WorkSheet.readXML(Unknown Source) at com.fr.stable.xml.XMLableReader.readXMLObject(Unknown Source) at com.fr.main.AbstractFineBook.readReportXML(Unknown Source) at com.fr.main.AbstractFineBook.readXML(Unknown Source) at com.fr.main.AbstractTemplateWorkBook.readXML(Unknown Source) at com.fr.stable.xml.XMLableReader.readXMLObject(Unknown Source) at com.fr.main.impl.WorkBook.readStream(Unknown Source) at com.fr.main.impl.WorkBook.readStream(Unknown Source) at com.fr.io.TemplateWorkBookIO.readTemplateWorkBook(Unknown Source) at MhiisFR.main(MhiisFR.java:27) 原代码: import java.io.File; import java.io.FileOutputStream; import com.fr.base.FRContext; import com.fr.base.Parameter; import com.fr.dav.LocalEnv; import com.fr.general.ModuleContext; import com.fr.io.TemplateWorkBookIO; import com.fr.io.exporter.PDFExporter; import com.fr.main.impl.WorkBook; import com.fr.main.workbook.ResultWorkBook; import com.fr.report.module.EngineModule; import com.fr.stable.WriteActor; public class MhiisFR { public static void main(String[] args) { // 定义报表运行环境,才能执行报表 String envpath = "C:\\FineReport_8.0\\WebReport\\WEB-INF"; FRContext.setCurrentEnv(new LocalEnv(envpath)); ModuleContext.startModule(EngineModule.class.getName()); ResultWorkBook rworkbook = null; try { // 未执行模板工作薄 WorkBook workbook = (WorkBook) TemplateWorkBookIO .readTemplateWorkBook(FRContext.getCurrentEnv(), "\\doc\\Advanced\\Logchart_1.cpt"); // 获取报表参数并设置值,导出内置数据集时数据集会根据参数值查询出结果从而转为内置数据集 Parameter[] parameters = workbook.getParameters(); parameters[0].setValue("华东"); // 定义parametermap用于执行报表,将执行后的结果工作薄保存为rworkBook java.util.Map parameterMap = new java.util.HashMap(); for (int i = 0; i < parameters.length; i++) { parameterMap.put(parameters.getName(), parameters .getValue()); } // 定义输出流 FileOutputStream outputStream; // 将结果工作薄导出为Pdf文件 outputStream = new FileOutputStream(new File("C:\\tmp\\PdfExport.pdf")); PDFExporter PdfExport = new PDFExporter(); PdfExport.export(outputStream, workbook.execute(parameterMap,new WriteActor())); outputStream.close(); ModuleContext.stopModules(); System.out.println("OK!!!"); } catch (Exception e) { e.printStackTrace(); } } } |
最佳回答 |
||||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|
|||
0
|
|