gemsley Posted May 13, 2016 Share Posted May 13, 2016 I am using the PHP client, trying to upload subreports to an existing report.I have a report at '/Reports/MyReport', so I tried to use$c->repositoryService()->createFileResource($file, $content, '/Reports/MyReport_files/subreport.jrxml')[/code]to upload it to the hidden _files directory each report unit has. This works - if I try to upload the file again, it says the file already exists. But it doesn't actually make it part of the report unit.How do I use the PHP client to upload a subreport to an existing report unit, and make it part of the report unit? Link to comment Share on other sites More sharing options...
bilel.krichen Posted June 10, 2016 Share Posted June 10, 2016 How can I add other sub resources to this report using PHP.I can't find any documentation of this case. $c = new Client("http://192.168.1.101:8080/jasperserver","jasperadmin","jasperadmin");try{ $report = new ReportUnit; $report->label = "file5Report"; $report->description = "file5Report"; $report->jrxml = "/jrxml/file2"; $report->dataSource = "/datasources/datasource"; $report->resources = array("/ImageFolder/Subjrxml"); $c->repositoryService()->createResource($report, "/ImageFolder", false);}catch (JaspersoftExceptionRESTRequestException $e){ echo $e->getMessage();}[/code]But always this error shown with message 'null' 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