In my app i need to generate several reports.
Right now i’m using yiijasper extension to make the “conection” between my app and the jasperserver to get the reports, but i’m not happy with the extension.
I know that jasper soft has a rest php client and i would like to integrate him in my app.
Can any one help me on how can i do this?
We’re using Jasper. We’re not doing anything fancy really. JasperServer does have a REST API. We are just fetching the report like so:
$report = file_get_contents( 'http://jasperserver.com/jasperserver/rest_v2/reports/reports/accounts/showAllAccounts.pdf' );
The first “reports” in the url is part of the API and tells Jasper what you’re doing, it has nothing to do with your report path. After that is when you put in the full path to your report. (E.g. the sample report path is /reports/accounts/showAllAccounts)
After your report name you simply add the file format you want your report in (.pdf). It must be a supported Jasper format (pdf, csv, etc).
To display the report we just set the content header accordingly and echo the content.
Jasper has been great for us. We actually only use Jasper server to design and build reports. We pass all of the report content from our Yii application via XML to Jasper.