Print button while creating a new document - ID: 2858657

This commit is contained in:
Heng Sin Low 2009-09-18 04:11:59 +00:00
parent 1f90a47bc0
commit 93144b9d16
1 changed files with 19 additions and 3 deletions

View File

@ -16,10 +16,11 @@
*****************************************************************************/
package org.compiere.print;
import java.lang.reflect.Method;
import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.webui.window.FDialog;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.apps.ADialog;
import org.compiere.apps.ProcessCtl;
import org.compiere.model.MPaySelectionCheck;
@ -32,7 +33,6 @@ import org.compiere.util.ASyncProcess;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.zkoss.zk.ui.Component;
/**
* Report Controller.
@ -257,7 +257,23 @@ public class ReportCtl
ReportEngine re = ReportEngine.get (Env.getCtx(), type, Record_ID);
if (re == null)
{
ADialog.error(0, null, "NoDocPrintFormat");
if (Ini.isClient())
{
ADialog.error(0, null, "NoDocPrintFormat");
}
else
{
try
{
ClassLoader loader = ReportCtl.class.getClassLoader();
Class<?> clazz = loader.loadClass("org.adempiere.webui.window.FDialog");
Method m = clazz.getMethod("error", Integer.TYPE, String.class);
m.invoke(null, 0, "NoDocPrintFormat");
} catch (Exception e)
{
throw new AdempiereException(e);
}
}
return false;
}