lavela / phpjasper

Create Reports in PHP with JasperReports
MIT License
66 stars 20 forks source link

Q: Passing Array Parameter #32

Closed tantanito closed 3 years ago

tantanito commented 6 years ago

I cant get it into work. The recieving parameter on the report is a Collections and a type of String. What is the proper way of passing. If i change the type to single value, it will work but I need to work with arrays, for WHERE IN query.

    $options = [
        'format' => ['pdf'],
        'locale' => 'en',
        'params' => [
            'TEST' => $request->get('prebid_ids'),    // Array to String Conversion Error
            // 'TEST' => implode(',', $request->get('prebid_ids')),
        ],
        'db_connection' => [
            'driver' => env('DB_CONNECTION'),
            'username' => env('DB_USERNAME'),
            'password' => env('DB_PASSWORD'),
            'host' => env('DB_HOST'),
            'database' => env('DB_DATABASE'),
            'port' => env('DB_PORT')
        ]
    ];

    $jasper = new PHPJasper;
    $jasper->process(
        $input, $output, $options
    )->execute();
caioviniciusrodrigues commented 2 years ago

Gostaria de saber a solução pfv tb, nao consigo passar uma collection