Daniel Quathamer
11 months ago
11 changed files with 20219 additions and 10616 deletions
@ -0,0 +1,101 @@ |
|||||||
|
package de.superx.bin; |
||||||
|
import java.io.File; |
||||||
|
import java.io.FileInputStream; |
||||||
|
import java.io.FileNotFoundException; |
||||||
|
import java.io.FileWriter; |
||||||
|
import java.io.IOException; |
||||||
|
import net.sf.jasperreports.engine.JRException; |
||||||
|
import net.sf.jasperreports.engine.JRExporterParameter; |
||||||
|
import net.sf.jasperreports.engine.JRParameter; |
||||||
|
import net.sf.jasperreports.engine.JasperCompileManager; |
||||||
|
import net.sf.jasperreports.engine.JasperExportManager; |
||||||
|
import net.sf.jasperreports.engine.JasperFillManager; |
||||||
|
import net.sf.jasperreports.engine.JasperPrint; |
||||||
|
import net.sf.jasperreports.engine.JasperPrintManager; |
||||||
|
import net.sf.jasperreports.engine.export.JRCsvExporter; |
||||||
|
import net.sf.jasperreports.engine.export.JRRtfExporter; |
||||||
|
import net.sf.jasperreports.engine.export.JRXlsExporter; |
||||||
|
import net.sf.jasperreports.engine.query.JRXPathQueryExecuterFactory; |
||||||
|
import net.sf.jasperreports.engine.util.JRXmlUtils; |
||||||
|
import net.sf.jasperreports.engine.util.JRLoader; |
||||||
|
/** |
||||||
|
* @author Daniel Quathamer Projektgruppe SuperX |
||||||
|
* |
||||||
|
* @ |
||||||
|
* Dieses Javaprogramm führt kompiliert JasperReports<br> |
||||||
|
* |
||||||
|
*Aufruf: java $JAVA_OPTS -cp "$CP" de.superx.bin.SxJasperCompiler <JRXML-Datei> |
||||||
|
|
||||||
|
Achtung: Der Workflow ist wie folgt: |
||||||
|
Quelldatei.jrxml ist die XML-Beschreibungsdatei des Berichts |
||||||
|
|
||||||
|
Task compile: Quelldatei.jrxml -> Quelldatei.jasper |
||||||
|
Quelldatei.jasper ist kompilierte Beschreibungsdatei für den Bericht |
||||||
|
|
||||||
|
|
||||||
|
*/ |
||||||
|
public class SxJasperCompiler { |
||||||
|
|
||||||
|
|
||||||
|
private static String usage = |
||||||
|
"-------------------------------------\nGebrauch: java de.superx.bin.SxJasperCompiler <<jrxml-Datei>> \n---------------------------------------------------"; |
||||||
|
|
||||||
|
/** |
||||||
|
* @param args |
||||||
|
* @throws ClassNotFoundException |
||||||
|
* @throws FileNotFoundException |
||||||
|
* @throws IOException |
||||||
|
* @throws SQLException |
||||||
|
*/ |
||||||
|
public static void go(String args[]) |
||||||
|
throws |
||||||
|
ClassNotFoundException, |
||||||
|
FileNotFoundException, |
||||||
|
IOException |
||||||
|
{ |
||||||
|
if (args.length== 0) { |
||||||
|
throw new IllegalArgumentException("Parameter jrxml-Datei erfoderlich"); |
||||||
|
|
||||||
|
} |
||||||
|
String jrxmlFileName=args[0]; |
||||||
|
String jasperFileName=de.memtext.util.FileUtils.getFileNameWithoutSuffix(jrxmlFileName)+".jasper";; |
||||||
|
|
||||||
|
try |
||||||
|
{ |
||||||
|
long start = System.currentTimeMillis(); |
||||||
|
if (!jrxmlFileName.equals("")) |
||||||
|
{ |
||||||
|
JasperCompileManager.compileReportToFile(jrxmlFileName,jasperFileName); |
||||||
|
System.out.println("File "+jasperFileName+" created, compile time : " + (System.currentTimeMillis() - start)+ "ms"); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
catch (JRException e) |
||||||
|
{ |
||||||
|
e.printStackTrace(); |
||||||
|
System.exit(1); |
||||||
|
} |
||||||
|
catch (Exception e) |
||||||
|
{ |
||||||
|
e.printStackTrace(); |
||||||
|
System.exit(1); |
||||||
|
} |
||||||
|
|
||||||
|
System.out.println("Compile erfolgreich beendet"); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String args[]) { |
||||||
|
try { |
||||||
|
go(args); |
||||||
|
} catch (Exception ex) { |
||||||
|
System.err.println("Aufruf fehlgeschlagen.\n" + ex); |
||||||
|
ex.printStackTrace(); |
||||||
|
System.exit(1); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -1 +1 @@ |
|||||||
05.09.2023 |
25.11.2023 |
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in new issue