Reportico 仅输出 PDF 或 CSV
Reportico output only PDF or CSV
我正在使用 Reportico 5.2.0 的 Laravel 扩展来生成报告。
我有一个表格,我在其中填写了所有查询参数,并有按钮来获取 HTML、PDF、CSV 的输出。
我能够获取 HTML 输出,因为它写在视图中并通过 ajax 返回。
我想在单击 PDF 按钮时获取 PDF。
我试过这个文档但没有成功
http://www.reportico.org/swsite/site/doc/reportico/tutorial_reportico.using.pkg.html#using.embedding
当我尝试按照他们的 laravel 文档在此处 http://www.reportico.org/laravel/public/index.php/embed-links
将 link 嵌入到视图中时
它指出 ModeController Not found error
是否只有点击 link 或通过 ajax 才能获取 PDF?
我找到了解决方案,
我只需要将我的 url 指向
http://{laravel_app_url}/index.php/reportico/ajax?project={project-name}
&target_format=PDF&report={XML-file}
并根据输出类型相应地更改 target_format
。但需要注意的是,我需要在生成 PDF 和 CSV 输出之前生成 HTML 输出。
另一种方法是使用专用路由 运行 报告 :-
http://{laravel_app_url}/index.php/reportico/execute/{project-name}/{reportname-without-xml-extension}?target_format=PDF
并以条件输入模式打开报告
http://{laravel_app_url}/index.php/reportico/prepare/{project-name}/{reportname-without-xml-extension}
我正在使用 Reportico 5.2.0 的 Laravel 扩展来生成报告。 我有一个表格,我在其中填写了所有查询参数,并有按钮来获取 HTML、PDF、CSV 的输出。
我能够获取 HTML 输出,因为它写在视图中并通过 ajax 返回。
我想在单击 PDF 按钮时获取 PDF。
我试过这个文档但没有成功 http://www.reportico.org/swsite/site/doc/reportico/tutorial_reportico.using.pkg.html#using.embedding
当我尝试按照他们的 laravel 文档在此处 http://www.reportico.org/laravel/public/index.php/embed-links
将 link 嵌入到视图中时
它指出 ModeController Not found error
是否只有点击 link 或通过 ajax 才能获取 PDF?
我找到了解决方案,
我只需要将我的 url 指向
http://{laravel_app_url}/index.php/reportico/ajax?project={project-name}
&target_format=PDF&report={XML-file}
并根据输出类型相应地更改 target_format
。但需要注意的是,我需要在生成 PDF 和 CSV 输出之前生成 HTML 输出。
另一种方法是使用专用路由 运行 报告 :-
http://{laravel_app_url}/index.php/reportico/execute/{project-name}/{reportname-without-xml-extension}?target_format=PDF
并以条件输入模式打开报告
http://{laravel_app_url}/index.php/reportico/prepare/{project-name}/{reportname-without-xml-extension}