用途:在 ERPNext/Frappe 中构建报表、图表与工作台 KPI。主要能力:区分 Query Report(简单 SQL,仅系统管理员)、Script Report(复杂逻辑与图表,需开发者模式)、Report Builder(终端用户自助)、Prepared Report(大数据集后台生成);支持图表(bar、line、pie、donut、percentage)、报表摘要、Number Card(Document Type、Report、Custom 三类)与 Dashboard Chart(Report、Group By、Custom)。用法:Script Report 由 .json、.py、.js 三文件组成,通过 Desk 新建并设 Is Standard=Yes;execute(filters) 按位置返回 columns、data、message、chart、report_summary、skip_total_rows;Query Report 使用 "Label:Fieldtype/Options:Width" 列别名与 %(filter_name)s 变量;大数据集在 .js 中设 prepared_report: true。限制与建议:WHERE/GROUP BY 列加索引,frappe.db.sql 用 as_dict=True,避免 SELECT * 与循环内 frappe.get_doc,按 docstatus 过滤,超 5 万行启用 prepared_report。具体版本兼容与安装方式暂未提供。
frappe-impl-reports
通用与其它
更新于 10-16 06:17