diff --git a/org.adempiere.report.jasper/src/org/compiere/report/ReportStarter.java b/org.adempiere.report.jasper/src/org/compiere/report/ReportStarter.java index 8f4ae29c4e..6670cbfd78 100644 --- a/org.adempiere.report.jasper/src/org/compiere/report/ReportStarter.java +++ b/org.adempiere.report.jasper/src/org/compiere/report/ReportStarter.java @@ -9,7 +9,7 @@ * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * - * For the text or an alternative of this public license, you may reach us * * + * For the text or an alternative of this public license, you may reach us * *****************************************************************************/ package org.compiere.report; @@ -408,10 +408,16 @@ public class ReportStarter implements ProcessCall, ClientProcess } for( int i=0; i 0) @@ -507,13 +513,16 @@ public class ReportStarter implements ProcessCall, ClientProcess PrintRequestAttributeSet prats = new HashPrintRequestAttributeSet(); // add: copies, job-name, priority - if (printInfo.isDocumentCopy() || printInfo.getCopies() < 1) + if (printInfo == null || printInfo.isDocumentCopy() || printInfo.getCopies() < 1) // @Trifon prats.add (new Copies(1)); else prats.add (new Copies(printInfo.getCopies())); Locale locale = Language.getLoginLanguage().getLocale(); - prats.add(new JobName(printFormat.getName() + "_" + pi.getRecord_ID(), locale)); - prats.add(PrintUtil.getJobPriority(jasperPrint.getPages().size() , printInfo.getCopies(), true)); + // @Trifon + String printFormat_name = printFormat == null ? "" : printFormat.getName(); + int numCopies = printInfo == null ? 0 : printInfo.getCopies(); + prats.add(new JobName(printFormat_name + "_" + pi.getRecord_ID(), locale)); + prats.add(PrintUtil.getJobPriority(jasperPrint.getPages().size(), numCopies, true)); // Create print service exporter JRPrintServiceExporter exporter = new JRPrintServiceExporter();; @@ -626,8 +635,15 @@ public class ReportStarter implements ProcessCall, ClientProcess ArrayList subreports = new ArrayList(); MAttachmentEntry[] entries = attachment.getEntries(); for(int i = 0; i < entries.length; i++) { - if (!entries[i].getName().equals(name) && - (entries[i].getName().toLowerCase().endsWith(".jrxml") || entries[i].getName().toLowerCase().endsWith(".jasper"))) { + // @Trifon + if (!entries[i].getName().equals(name) + && (entries[i].getName().toLowerCase().endsWith(".jrxml") + || entries[i].getName().toLowerCase().endsWith(".jasper") + || entries[i].getName().toLowerCase().endsWith(".jpg") + || entries[i].getName().toLowerCase().endsWith(".png") + ) + ) + { File reportFile = getAttachmentEntryFile(entries[i]); if (reportFile != null) subreports.add(reportFile);