Skip to content

Commit 9eecd2d

Browse files
author
Daniel Rodrigues Lima
committed
general updates
1 parent 471c43b commit 9eecd2d

File tree

7 files changed

+19
-193
lines changed

7 files changed

+19
-193
lines changed

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,16 @@ public function xmlToPdf()
272272
$data_file = public_path() . '/report/CancelAck.xml';
273273
$driver = 'xml';
274274
$xml_xpath = '/CancelResponse/CancelResult/ID';
275-
276-
\JasperPHP::process(
277-
public_path() . '/report/CancelAck.jrxml',
278-
$output,
275+
276+
$php_jasper = new JasperPHP;
277+
278+
$php_jasper->process(
279+
public_path() . '/report/CancelAck.jrxml',
280+
$output,
279281
array($ext),
280282
array(),
281-
array('data_file' => $data_file, 'driver' => $driver, 'xml_xpath' => $xml_xpath),
282-
false,
283-
false
284-
)->execute();
285-
283+
array('data_file' => $data_file, 'driver' => $driver, 'xml_xpath' => $xml_xpath))->execute();
284+
286285
header('Content-Description: File Transfer');
287286
header('Content-Type: application/octet-stream');
288287
header('Content-Disposition: attachment; filename='.time().'_CancelAck.'.$ext);
@@ -293,16 +292,15 @@ public function xmlToPdf()
293292
flush();
294293
readfile($output.'.'.$ext);
295294
unlink($output.'.'.$ext);
296-
297295
}
298296
```
299297
**Note:**
300298

301299
To use the example above you must copy the sample files located at:
302300

303-
**\vendor\lavela\phpjasper\src\JasperStarter\examples\CancelAck.jrxml**
301+
**\vendor\lavela\phpjasper\examples\CancelAck.jrxml**
304302
and
305-
**\vendor\lavela\phpjasper\src\JasperStarter\examples\CancelAck.xml**
303+
**\vendor\lavela\phpjasper\examples\CancelAck.xml**
306304
to folder:
307305
**\public\report**
308306

@@ -322,15 +320,16 @@ public function jsonToPdf()
322320
$driver = 'json';
323321
$json_query= "contacts.person";
324322
$data_file = public_path() . '/report/contacts.json';
325-
326-
\JasperPHP::process(
323+
324+
$php_jasper = new JasperPHP;
325+
326+
$php_jasper->process(
327327
public_path() . '/report/json.jrxml',
328328
$output,
329329
array($ext),
330330
array(),
331-
array('data_file' => $data_file, 'driver' => $driver, 'json_query' => $json_query
332-
)->execute();
333-
331+
array('data_file' => $data_file, 'driver' => $driver, 'json_query' => $json_query))->execute();
332+
334333
header('Content-Description: File Transfer');
335334
header('Content-Type: application/octet-stream');
336335
header('Content-Disposition: attachment; filename='.time().'_Contacts.'.$ext);
@@ -341,16 +340,15 @@ public function jsonToPdf()
341340
flush();
342341
readfile($output.'.'.$ext);
343342
unlink($output.'.'.$ext);
344-
345343
}
346344
```
347345
**Note:**
348346

349347
To use the example above you must copy the sample files located at:
350348

351-
**\vendor\lavela\phpjasper\src\JasperStarter\examples\json.jrxml**
349+
**\vendor\lavela\phpjasper\examples\json.jrxml**
352350
and
353-
**\vendor\lavela\phpjasper\src\JasperStarter\examples\contacts.json**
351+
**\vendor\lavela\phpjasper\examples\contacts.json**
354352
to folder:
355353
**\public\report**
356354

File renamed without changes.

examples/json.jrxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@
126126
<summary>
127127
<band/>
128128
</summary>
129-
</jasperReport>
129+
</jasperReport>

src/JasperStarter/examples/contacts.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/JasperStarter/examples/contacts.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/JasperStarter/examples/json.jrxml

Lines changed: 0 additions & 129 deletions
This file was deleted.

0 commit comments

Comments
 (0)