jking_3 Posted April 19, 2016 Share Posted April 19, 2016 I have a Report that I created in Jaspersoft Studio that has a parameter as part of the main dataset query: select *from subjects as sjoin juror_subjects as js on js.resources_id = s.resources_idjoin resources as r on r.id = s.resources_idjoin matters as m on m.id = r.matters_idwhere r.id = $P{subjects_id}[/code]when I preview this in Jaspersoft Studio, it prompts for the subjects_id, and once I enter it, the report runs successfully.Also, when I run it on JasperServer, it prompts for the subjects_id, and once I enter it, the report runs correctly.However, when I request it from our API (which is the ultimate implementation we are aiming for), it returns a blank page.API code:public function main(){ $inputControls = array( 'subjects_id' => 95488 ); $report = $this->c->reportService()->runReport('/reports/JurorReport', 'pdf', null, null, $inputControls); header("Content-Type: application/pdf"); echo $report; die;}[/code]This API code is just for test purposes right now.Can anyone help me understand why I am unable to request reports with $P parameters in the dataset query? I have confirmed that if I remove the parameters, the report runs correctly.I appreciate any help you can offer. Link to comment Share on other sites More sharing options...
hozawa Posted April 21, 2016 Share Posted April 21, 2016 Use the REST API. Be sure to specify j_username and j_password in the URI so you'll be logged in. Otherwise, you'll just get a security error.http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v621/reports-service Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now