PHPJasper / phpjasper

A PHP report generator
MIT License
463 stars 162 forks source link

Does this work on Windows #318

Open malcolmfowler opened 2 years ago

malcolmfowler commented 2 years ago

I followed the instructions and the example report has the following error;

Fatal error: Uncaught PHPJasper\Exception\ErrorCommandExecutable: Your report has an error and couldn 't be processed!\ Try to output the command using the function output(); and run it manually in the console. in C:\xampp\htdocs\reporting\vendor\geekcom\phpjasper\src\PHPJasper.php:250 Stack trace: #0 C:\xampp\htdocs\reporting\test_customer_report.php(30): PHPJasper\PHPJasper->execute() #1 {main} thrown in C:\xampp\htdocs\reporting\vendor\geekcom\phpjasper\src\PHPJasper.php on line 250

USING OUTPUT() jasperstarter process "C:\xampp\htdocs\reporting/reports/hello_world.jrxml" -o "C:\xampp\htdocs\reporting/customer_reports" -f pdf rtf

adeelahmed233 commented 2 years ago

I am also getting this error with MySql in Windows 10 64 bit.

Here is the code I am using `<?php // Required to take the phprunner context ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); //include("../include/dbcommon.php");

require_once DIR . '/../endroid/vendor/autoload.php';

use PHPJasper\PHPJasper;

$inputraw = DIR . '/../endroid/vendor/geekcom/phpjasper/examples/FA_2x1.jrxml';

$jasper = new PHPJasper; $jasper->compile($inputraw)->execute();

$input = DIR . '/../endroid/vendor/geekcom/phpjasper/examples/FA_2x1.jasper';
$output = DIR . '/../endroid/vendor/geekcom/phpjasper/examples'; $options = [ 'format' => ['pdf'], 'locale' => 'en', 'params' => [], 'db_connection' => [ 'driver' => 'mysql', //mysql, .... 'username' => 'root', 'password' => '', 'host' => '127.0.0.1', 'database' => 'abcd', 'port' => '3306'] ];

$jasper = new PHPJasper;

$jasper->process( $input, $output, $options )->execute();`

Please help

rizts commented 2 years ago

anyone have fixed this issue? I tried to process it on ubuntu and worked properly but when I did it on windows (xampp), the report just show null value whilst the project must be run on windows