NopReport

NopReport是一款开源的基于Excel作为可视化设计器的中国式报表引擎,支持复杂结构报表制作,具有高性能和灵活性,可独立使用或集成到第三方软件中。

Check out NopReport on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

项目地址: https://github.com/entropy-cloud/nop-entropy演示视频: https://www.bilibili.com/video/BV1Sa4y1K7tD/中国式报表是复杂结构报表的代名词,它泛指国内信息化领域经常出现的基于多源数据,采用行列交叉、多层级表头、自由分片合并等形式所展现的信息汇总报表。目前国内商业化的报表工具都支持中国式报表的制作,但是开源的报表引擎中只有UReport支持中国式报表,而且目前已经不再维护。NopReport是基于可逆计算理论从零开始独立实现的一套开源中国式报表引擎,它的核心代码很短,只有3000多行(参见nop-report-core模块),具有较高的性能(性能测试代码参见TestReportSpeed.java),以及其他报表引擎难以达到的灵活性和可扩展性。NopReport是Nop平台内置的报表引擎,它可以独立于Nop平台被第三方软件所使用。NopReport的体积很小,使用了自己编写的XML解析器,不依赖于POI包,直接读写XLSX格式的Excel文件,可以在Android平台上运行,可以制作各类常见的复杂中国式报表。# 示例截图:## 档案式报表## 段落明细表## 复杂多源报表## 交叉报表—数据双向扩展## 同比环比等财务统计表# 集成代码1. 在pom文件中引入依赖xml <dependency> <groupId>io.github.entropy-cloud</groupId> <artifactId>nop-report-core</artifactId> <version>2.0.0-SNAPSHOT</version> </dependency>2. 在Java代码中使用ReportEnginejavapublic class TestReportFile { @BeforeAll public static void init() { // 初始化Nop平台,全局只需要调用一次 CoreInitialization.initialize(); } @AfterAll public static void destroy() { CoreInitialization.destroy(); } @Test public void testReportResource() { // 如果从_vfs所对应的虚拟文件目录下加载报表文件,则可以直接调用reportEngine上的方法 IReportEngine reportEngine = newReportEngine(); ITemplateOutput output = reportEngine.getRenderer("/nop/report/demo/test.xpt.xlsx", "xlsx"); IEvalScope scope = XLang.newEvalScope(); scope.setLocalValue("title", "测试报表,标题显示在右上角"); File outputFile = new File("output2.xlsx"); output.generateToFile(outputFile, scope); } IReportEngine newReportEngine() { ReportEngine reportEngine = new ReportEngine(); Map<String, IReportRendererFactory> renderers = new HashMap<>(); renderers.put(XptConstants.RENDER_TYPE_XLSX, new XlsxReportRendererFactory()); renderers.put(XptConstants.RENDER_TYPE_HTML, new HtmlReportRendererFactory()); reportEngine.setRenderers(renderers); return reportEngine; }}