简体   繁体   English

Reportico仅输出PDF或CSV

[英]Reportico output only PDF or CSV

I am using Laravel extension of Reportico 5.2.0 for report generation. 我正在使用Reportico 5.2.0的 Laravel扩展来生成报告。 I have a form in which I fill all the query parameters and have buttons to get output of HTML, PDF, CSV. 我有一个表单,其中填写了所有查询参数,并且具有获取HTML,PDF,CSV输出的按钮。

I am able to fetch the HTML output as it is written in a view and is returned via ajax. 我能够获取HTML输出,因为它是在视图中编写并通过ajax返回的。

I would like to get PDF when I click on PDF button. 当我单击PDF按钮时,我想获取PDF。

I tried this documentation but was unsuccessful http://www.reportico.org/swsite/site/doc/reportico/tutorial_reportico.using.pkg.html#using.embedding 我尝试了此文档,但http://www.reportico.org/swsite/site/doc/reportico/tutorial_reportico.using.pkg.html#using.embedding失败

When I try to embed link within view following their laravel documentation here http://www.reportico.org/laravel/public/index.php/embed-links 当我尝试按照其laravel文档在此处将链接嵌入视图中时, 请访问http://www.reportico.org/laravel/public/index.php/embed-links
it states ModeController Not found error 它指出ModeController Not found error

Is it possible to get PDF only when clicked on the link or via ajax? 仅当单击链接或通过ajax时才可以获取PDF吗?

I found the solution, 我找到了解决方案,

I just needed to point my url to 我只需要将我的网址指向

http://{laravel_app_url}/index.php/reportico/ajax?project={project-name}
&target_format=PDF&report={XML-file}

and change the target_format accordingly for the output type. 并相应地更改输出类型的target_format But the caveat is, I need to generate the HTML output before generating the PDF and CSV output. 但是需要注意的是,在生成PDF和CSV输出之前,我需要先生成HTML输出。

Also another way to do it is use the dedicated route for running a report :- 另一种执行此操作的方法是使用专用路由来运行报告:-

http://{laravel_app_url}/index.php/reportico/execute/{project-name}/{reportname-without-xml-extension}?target_format=PDF

And to open a report in criteria entry mode 并在条件输入模式下打开报告

http://{laravel_app_url}/index.php/reportico/prepare/{project-name}/{reportname-without-xml-extension}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM