Created
April 29, 2011 07:44
-
-
Save esaounkine/948000 to your computer and use it in GitHub Desktop.
Silent Jasper print sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void createReport(String[] jasperFileUrls, Map parameters, JRDataSource ds, String type, | |
String selectedPrinter) { | |
Vector jasperPrintList = new Vector(0); | |
for(String s : jasperFileUrls) { | |
try { | |
jasperPrintList.add(JasperFillManager.fillReport((JasperReport)JRLoader.loadObject(s), parameters, ds)); | |
System.out.println("Added report: " + s + " to the printlist"); | |
} | |
catch(JRException jre) { | |
System.err.println("Failed to add the report '" + s + "' due to exception: " + | |
jre.getMessage()); | |
} | |
} | |
try { | |
printReport(jasperPrintList, selectedPrinter); | |
} | |
catch(Exception e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment