SIMITGROUP / phpjasperxml

This is a php wysiwyg report library
BSD 3-Clause "New" or "Revised" License
44 stars 45 forks source link

Undefined property: PHPJasperXML::$footerbandheight #17

Closed acer22969 closed 6 years ago

acer22969 commented 6 years ago

I'm use php7.2 +laravel5.6 +MSSQL+phpjasper-laravel(from geekcom)+jaspersoft Here is my part of code in laravel Controller :

$server = "localhost";
$user="test123";
$pass = "test123";
$db = "test";

$PHPJasperXML = new PHPJasperXML("en","TCPDF");
$PHPJasperXML->arrayParameter=array('para1'=>'1','para2'=>'2');
$PHPJasperXML->load_xml_file(app_path().'/lib/PHPJasperXML/sample1.jrxml');
$dbdriver="sqlsrv";
$PHPJasperXML->transferDBtoArray($server,$user,$pass,$db,$dbdriver);
$PHPJasperXML->outpage('I'); 

Here is the error i get in laravel : image

Please teach me how to fix this kind of error Thank you very much!

kstan79 commented 6 years ago

hi, seems php7.2 required to declare every attribute in the class. What you can do is declare all variable in the class:

private $footerbandheight=0;

acer22969 commented 6 years ago

It's work!! Thanks for your answer.

kstan79 commented 6 years ago

You may send pull request if you test it work perfectly.