jasper report loading in PHP is failed


I have installed jasper server and xampp, now i need to generated the report in jasper server using PHP.

I have downloaded the code zip from https://github.com/Jaspersoft/jrs-rest-php-client

and my code is:

require_once __DIR__ . "/jaspa/autoload.dist.php";
header('Content-Type: text/html');
use Jaspersoft\Client\Client;
$c = new Client(
$report = $c->reportService()->runReport('/reports/samples/AllAccounts', 'html');
echo $report;
It showing the error
Fatal error: Uncaught exception 'Jaspersoft\Exception\RESTRequestException' with message 'An unexpected HTTP status code was returned by the server' in C:\xampp\htdocs\jasper\src\Jaspersoft\Tool\RESTRequest.php:395 Stack trace: #0 C:\xampp\htdocs\jasper\src\Jaspersoft\Tool\RESTRequest.php(479): Jaspersoft\Tool\RESTRequest->handleError(404, Array, '<!DOCTYPE HTML ...') #1 C:\xampp\htdocs\jasper\src\Jaspersoft\Service\ReportService.php(40): Jaspersoft\Tool\RESTRequest->prepAndSend('localhost/rest_...', Array, 'GET', NULL, true) #2 C:\xampp\htdocs\test\report.php(18): Jaspersoft\Service\ReportService->runReport('/reports/AllAcc...', 'jrxml') #3 {main} thrown inC:\xampp\htdocs\jasper\src\Jaspersoft\Tool\RESTRequest.php on line 395
Please Help me to generate report using jasper in PHP.
dileep.tananki's picture
Joined: Nov 23 2015 - 4:57am
Last seen: 4 years 8 months ago

0 Answers:

No answers yet