how to create a report using jaspersoft php client

5

Hi,

    I'm new to jaspersoft. I'm working on a php web application and i want to implement jaspersoft reporting in it. I went through a lot of the available documentation. I used rest api and i was able to connect to the repository and download a report present in the repository as a pdf. My question is is it possible to create a report using php client. I didn't find any example doing that. Also i want to know if it is possible to use mysql queries to fetch data from a DB and use that data to create a report. Any help is appreciated.

Thanks in advance

 

ajesh.s's picture
33
Joined: Aug 15 2013 - 11:29pm
Last seen: 5 years 8 months ago

2 Answers:

0

Sorry my friend... is imposible, ... you must desing your report in jasperstudio and create a web interface to send it parameters to your report...

http://community.jaspersoft.com/wiki/php-client-sample-code

 

plantillas's picture
Joined: Apr 8 2015 - 12:49pm
Last seen: 3 years 8 months ago
0

Yes you can do it by using composite resources that you can specify your data sources your jrxml file, input controls
 

 $c = new Client(
"http://localhost:8080/jasperserver",
"jasperadmin",
"jasperadmin");
 
try{
     $report = new ReportUnit;
     $report->label = "file5Report";
     $report->description = "file5Report";
     $report->jrxml = "/jrxml/file2";
     $report->dataSource = "/datasources/datasource";
     $c->repositoryService()->createResource($report, "/ImageFolder", false);
}catch (\Jaspersoft\Exception\RESTRequestException $e){
      echo $e->getMessage();
}

I hope that my answer is helpfull

bilel.krichen's picture
Joined: Jun 9 2016 - 3:39am
Last seen: 2 years 10 months ago
Feedback
randomness