Jump to content

how to create a report using jaspersoft php client


ajesh.s

Recommended Posts

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

 

Link to comment
Share on other sites

  • 1 year later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...

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 (JaspersoftExceptionRESTRequestException $e){      echo $e->getMessage();}[/code]

I hope that my answer is helpfull

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...