-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIdentifyParameters.php
More file actions
29 lines (24 loc) · 832 Bytes
/
IdentifyParameters.php
File metadata and controls
29 lines (24 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
// Define paths
$javaExecutable = 'java'; // Adjust the path if necessary
$extractorClass = 'ParameterIdentifier';
$jasperFilePath = 'report'; // Update this path
// Construct the command
$command = sprintf(
'%s -cp ".;lib/*" %s %s',
escapeshellcmd($javaExecutable),
escapeshellcmd($extractorClass),
escapeshellarg("Files/" . $jasperFilePath . ".jasper")
);
// Provide font
// jasperstarter pr /path/to/your/report.jasper -f pdf -o /path/to/output/report.pdf -P param1=value1 -P param2=value2 -f /path/to/font.ttf
// Execute the command
exec($command, $output, $return_var);
if ($return_var === 0) {
echo "Parameters required by the Jasper file:\n";
foreach ($output as $parameter) {
echo $parameter . "\n";
}
} else {
echo "Failed to extract parameters. Command output: " . implode("\n", $output);
}