SIMITGROUP / phpjasperxml

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

No results thrown error #78

Closed mattfreitas closed 2 years ago

mattfreitas commented 2 years ago

Hi, it's not documented where i should handle when the report has no data.. Currently this is the error: No data found, and noData band undefined How should i handle that? I don't know if it's a bug or a lack of feature. Thanks.

kstan79 commented 2 years ago

No data found usually sql execution cannot fetch row from server (mean 0 row), that's why it can't render the pdf. You may add nodata band if you wish to draw custom pdf content.

williambh commented 2 years ago

I must add 2 lines on my composer.json to fix a BUG and a missing 'case' key.

  1. sed -i "s|password = \$config\['user'\]|password=\$config\['pass'\]|" vendor/simitgroup/phpjasperxml/src/datadrivers/Pdo_driver.php
  2. sed -i "s|case 'java.lang.Long':|case 'java.lang.Long':\n\t\tcase 'java.lang.Integer':|" vendor/simitgroup/phpjasperxml/src/PHPJasperXML_load.php

On first file, the class PDO_driver has a BUG! The array $config key pass it's missing! This was showing me the error "No data found, and noData band undefined". (line 66) On second file, my report parameter type 'java.lang.Integer' was missing on switch that map parameter data type... (line 353)

kstan79 commented 2 years ago

i'd fix this bugs. thanks feed back!