PHPJasper / phpjasper

A PHP report generator
MIT License
457 stars 161 forks source link

Parameter list #303

Open schmidtkropp opened 2 years ago

schmidtkropp commented 2 years ago

Hello, everyone,

I cannot give PHPJasper an array as a list in the parameters.

Can someone help?

` $params = ["Kurstypen" => ['22'], "Kurse" => ['72','62'], 'vonDatum' => '2021-01-01', 'bisDatum' => '2021-12-31'];

$options = [ 
        'format' => [strtolower($report['exportformat'])],
        'params' => $params,
        'db_connection' => [
            'driver' => 'mysql', 
            'username' => db_user,
            'password' => db_pass,
            'host' => db_host,
            'database' => db_name,
            'port' => db_port
        ]
    ];

`

error message: Parameter 'Kurstypen' of type 'java.util.List with value 'Array' is not supported by JasperStarter!

Xint0-elab commented 2 years ago

There is no support for passing array parameters to the report using JasperStarter which is the java program used by phpjasper to process the reports.

Maybe you can pass values as a string and depending on your particular use case either parse the value in the report or pass it as-is into the query of the report.