Skip to content

Commit fe38d23

Browse files
committed
Merge pull request #1 from lavela/master
Update
2 parents e7daba9 + 0f4a013 commit fe38d23

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/JasperPHP/JasperPHP.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ public function process($input_file, $output_file = false, $format = array("pdf"
105105
if( count($db_connection) > 0 )
106106
{
107107
$command .= " -t " . $db_connection['driver'];
108-
$command .= " -u " . $db_connection['username'];
108+
109+
if(isset($db_connection['username']))
110+
$command .= " -u " . $db_connection['username'];
109111

110112
if( isset($db_connection['password']) && !empty($db_connection['password']) )
111113
$command .= " -p " . $db_connection['password'];
@@ -131,6 +133,12 @@ public function process($input_file, $output_file = false, $format = array("pdf"
131133
if ( isset($db_connection['db_sid']) && !empty($db_connection['db_sid']) )
132134
$command .= ' --db-sid ' . $db_connection['db_sid'];
133135

136+
if ( isset($db_connection['xml_xpath']) )
137+
$command .= ' --xml-xpath ' . $db_connection['xml_xpath'];
138+
139+
if ( isset($db_connection['data_file']) )
140+
$command .= ' --data-file ' . "\"".$db_connection['data_file']."\"";
141+
134142
}
135143

136144
$this->redirect_output = $redirect_output;

0 commit comments

Comments
 (0)