基于报表和模板的报告生成方法研究
2021-05-29毛燠锋潘玉春朱玉付
毛燠锋 潘玉春 朱玉付



摘 要:随着电力报表在输变电运维中的普及以及数据分析报告生成的迫切需求,急需一种将报表数据转换成可用的分析报告的方法。本文针对上述需求,提出了一套完整的基于电力报表和Apache POI技术的分析报告生成流程,实现了将历史数据以图表的形式嵌入预设模板中,并最终形成格式统一的分析报告,有效地提高了数据分析人员的效率。
关键词:数据挖掘;电力报表;分析报告;Apache POI;模板
中图分类号:TP391 文献标识码:A
A Report Generation Method based on Report Form and Template
MAO Yufeng, PAN Yuchun, ZHU Yufu
(NR Electric CO., LTD., Nanjing 211102, China)
maoyf@nrec.com; panyc@nrec.com; zhuyufu@nrec.com
Abstract: With the popularity of power reports in operation and maintenance of power transmission and transformation, and the urgent need for data analysis reports, a method of converting report data into usable analysis reports is urgently needed. To meet the above needs, this paper proposes a complete analysis report generation process based on power reports and Apache POI technology. The proposed method makes historical data embedded into the preset template in the form of charts, and finally forms a unified analysis report. It effectively improves the efficiency of data analysts.
Keywords: data mining; power report; analysis report; Apache POI; template
1 引言(Introduction)
虽然电力行业目前有很多成熟的B/S或者C/S数据展示系统,但通常是作为展示工具的,即使有下载功能也仅仅是将查询到的数据以各种图表的形式展示出来,无法直接生成分析报告的形式。对于需要分析报告用于汇报或者归档的用户来说,实现分析文档的自动生成工作必要而且急切。本文介绍了一种方便快捷的分析文档生成方式,即先按照用户的需求使用报表工具将电力实时库中的数据以图表的形式导出到Excel中,然后使用POI类库取出相应的数据并插入预设模板中生成符合用户需求的分析报告。针对生成的报告在不同的Office工具中格式不一致问题,使用OpenOffice[1]软件实现版本转换,并最终生成样式固定的可直接使用的数据分析报告。
2 相关技术(Related technologies)
电力数据通常保存在实时数据库中,要利用相关数据生成文档需要将数据库中的数据提取出来并以图表的形式进行表示,鉴于电力报表的高实用性与可扩展性,可用于实现该功能。……
