欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 明星 > PHP:连接Grid++Report模板,实现循环打印

PHP:连接Grid++Report模板,实现循环打印

2025/11/19 5:07:36 来源:https://blog.csdn.net/weixin_46001736/article/details/144372682  浏览:    关键词:PHP:连接Grid++Report模板,实现循环打印

实现效果

模板

代码

cycle.php

<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Web报表(B/S报表)演示 - 不用报表插件展现报表而是直接输出</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="php/plugins/CreateControl.js" type="text/javascript"></script><script type="text/javascript">CreateReport("Report");function btnLoopPrint_onclick() {var wip_name = ['KRS20241202002-001-01', 'WP2024120301-01'];var reports = [];// 动态生成 reports 数组for (var i = 0; i < wip_name.length; i++) {reports.push({report: "test.grf",data: "DataCenter.php?data=YinxunSchedule&wip_entity_name=" + encodeURIComponent(wip_name[i])});}var success, reportLen = reports.length;success = Report.BeginLoopPrint(3, true); // 循环打印开始时调用。grpgsAll 3 生成报表所有数据。if (!success) {return;}for (i = 0; i < reportLen; i++) {// 载入要打印的报表模板SyncReportLoad(Report, "php/grf/" + reports[i].report);// 载入报表数据SyncReportLoadData(Report, "php/data/" + reports[i].data);Report.LoopPrint(true); // 执行一次循环打印}Report.EndLoopPrint(); // 循环打印结束时调用}</script></head><body><p><input id="btnLoopPrint" onclick="return btnLoopPrint_onclick()" type="button" value="循环打印" />&nbsp;</p>
</body></html>

数据查询

项目/php/data/DataCenter.php

Master:查询头信息

Detail:查询行信息

$_GET['wip_entity_name']为接收的参数

参考php/plugins/02.PrintDirect/PrintDirect.htm的循环打印

解析

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词