Jump to content
We've recently updated our Privacy Statement, available here ×

Use PHP to create a folder in JasperReports Server


michaelkuan8888

Recommended Posts

I want to use PHP to create a folder named test under /root/Reports folder in JasperReports Server.

I see this link (http://community.jaspersoft.com/wiki/php-client-sample-code) and write my code.

Here is my code:

<?php

    $c = new JaspersoftClientClient("http://localhost:8080/jasperserver","jasperadmin","jasperadmin");
 
    $folder = new Folder;
    $folder->label = "test"
 
    $c->repositoryService()->createResource($folder,"/Reports/");
?>
 
However, JasperReports Server doesn't create a test folder.
What is the errors that I made?
Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi there - Maybe your have this already, but connection criteria is also needed.  This is very rough, but I am assuming you have some experience with PHP.  More information on your problem will help.       

error_reporting( E_ALL ^ E_DEPRECATED );

require_once "php-sample/rest/client/JasperClient.php";   

$client = new JasperJasperClient (

   'localhost',
 
   8080,
 
   'jasperadmin',
 
   'jasperadmin',
 
   '/jasperserver-pro',
 
   'organization_1'
 
); 
 
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...