Skip to content

Commit c40800b

Browse files
authored
Update README.md
1 parent 4fe29c2 commit c40800b

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -184,35 +184,28 @@ require __DIR__ . '/vendor/autoload.php';
184184

185185
use JasperPHP\JasperPHP;
186186

187-
$input = __DIR__ . '/vendor/geekcom/phpjasper/examples/hello_world.jrxml';
188-
$output = __DIR__ . '/vendor/geekcom/phpjasper/examples';
189-
190-
private $conn;
191-
192-
public function __construct()
193-
{
194-
$this->conn = [
195-
'driver' => 'postgres',
196-
'username' => 'DB_USERNAME',
197-
'password' => 'DB_PASSWORD',
198-
'host' => 'DB_HOST',
199-
'database' => 'DB_DATABASE',
200-
'schema' => 'DB_SCHEMA',
201-
'port' => '5432'
202-
];
203-
}
187+
$input = '/your_input_path/your_report.jasper';
188+
$output = '/your_output_path';
189+
$format = 'pdf';
190+
$locale = 'en';
204191

205192
$jasper = new JasperPHP;
206193

207194
$jasper->process(
208195
$input,
209196
$output,
210-
array("pdf", "rtf"),
211-
array("php_version" => phpversion()),
212-
$this->conn,
213-
true,
214-
true,
215-
'pt_BR' //LOCALE *note 2
197+
$format,
198+
[],
199+
[
200+
'driver' => 'postgres',
201+
'username' => 'DB_USERNAME',
202+
'password' => 'DB_PASSWORD',
203+
'host' => 'DB_HOST',
204+
'database' => 'DB_DATABASE',
205+
'schema' => 'DB_SCHEMA',
206+
'port' => '5432'
207+
],
208+
$locale
216209
)->execute();
217210
```
218211

0 commit comments

Comments
 (0)