1003646 Print Dunning Letter - Null Pointer Exception.

This commit is contained in:
Heng Sin Low 2013-12-20 17:08:19 +08:00
parent 9dff6966e0
commit c218175559
1 changed files with 14 additions and 4 deletions

View File

@ -123,7 +123,7 @@ public class DunningPrint extends SvrProcess
int count = 0; int count = 0;
int errors = 0; int errors = 0;
MDunningRunEntry[] entries = run.getEntries(false); MDunningRunEntry[] entries = run.getEntries(false);
List<File> pdfList = new ArrayList<File>(); final List<File> pdfList = new ArrayList<File>();
for (int i = 0; i < entries.length; i++) for (int i = 0; i < entries.length; i++)
{ {
MDunningRunEntry entry = entries[i]; MDunningRunEntry entry = entries[i];
@ -258,6 +258,18 @@ public class DunningPrint extends SvrProcess
return msgreturn.toString(); return msgreturn.toString();
} }
AEnv.executeAsyncDesktopTask(new Runnable() {
@Override
public void run() {
showReports(pdfList);
}
});
StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count);
return msgreturn.toString();
} // doIt
private void showReports(List<File> pdfList) {
if (pdfList.size() > 1) { if (pdfList.size() > 1) {
try { try {
File outFile = File.createTempFile("DunningPrint", ".pdf"); File outFile = File.createTempFile("DunningPrint", ".pdf");
@ -278,8 +290,6 @@ public class DunningPrint extends SvrProcess
log.log(Level.SEVERE, e.getLocalizedMessage(), e); log.log(Level.SEVERE, e.getLocalizedMessage(), e);
} }
} }
StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count); }
return msgreturn.toString();
} // doIt
} // DunningPrint } // DunningPrint