Integrated Jasper Reports as optional printengine.

See "JasperReport Printengine" Feature Request for further details.
Without explicit usage of the printengine (the default), the old standard adempiere printengine will be used.
This commit is contained in:
deathmeat 2007-02-28 17:57:05 +00:00
parent f478a59fb5
commit 21791d90c7
16 changed files with 634 additions and 376 deletions

View File

@ -18,7 +18,8 @@
<property name="jar.name" value="CompiereJasper"/>
<property name="needed.jar.name" value="CompiereJasperReqs"/>
<property name="version" value="_1"/>
<property environment="env"/>
<!--<property environment="env"/>-->
<import file="../utils_dev/properties.xml"/>
<!-- set path to include the necessary jar files for javac -->
<path id="project.class.path">
@ -50,6 +51,7 @@
<javac srcdir="${src}" destdir="${build.dir}" deprecation="on" source="1.4" target="1.4" debug="on">
<classpath>
<pathelement path="${classpath}"/>
<pathelement path="../lib/Adempiere.jar"/>
<pathelement path="../base/Base.jar"/>
<pathelement path="../dbPort/dbPort.jar"/>
<pathelement path="../extend/Extend.jar"/>
@ -99,12 +101,12 @@
<fileset dir="${build.dir}"/>
<manifest>
<attribute name="Specification-Title" value="Add-on for Jasper Reports integration on org.compiere.report.ReportStarter"/>
<attribute name="Specification-Version" value="${env.COMPIERE_VERSION}${version}"/>
<attribute name="Specification-Vendor" value="Compiere.org"/>
<attribute name="Implementation-Title" value="CompiereJasper ${env.COMPIERE_VERSION}${version}"/>
<attribute name="Implementation-Version" value="${env.COMPIERE_VERSION}${version} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${env.COMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.compiere.org"/>
<attribute name="Specification-Version" value="${env.ADEMPIERE_VERSION}${version}"/>
<attribute name="Specification-Vendor" value="Adempiere.org"/>
<attribute name="Implementation-Title" value="CompiereJasper ${env.ADEMPIERE_VERSION}${version}"/>
<attribute name="Implementation-Version" value="${env.ADEMPIERE_VERSION}${version} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${env.ADEMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.adempiere.org"/>
<attribute name="Main-Class" value="org.compiere.report.ReportStarter"/>
</manifest>
</jar>
@ -138,12 +140,12 @@
<fileset dir="${needed.dir}"/>
<manifest>
<attribute name="Specification-Title" value="Needed libraries for Jasper Reports integration on org.compiere.report.ReportStarter"/>
<attribute name="Specification-Version" value="${env.COMPIERE_VERSION}${version}"/>
<attribute name="Specification-Vendor" value="Compiere.org"/>
<attribute name="Implementation-Title" value="CTools ${env.COMPIERE_VERSION}${version}"/>
<attribute name="Implementation-Version" value="${env.COMPIERE_VERSION}${version} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${env.COMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.compiere.org"/>
<attribute name="Specification-Version" value="${env.ADEMPIERE_VERSION}${version}"/>
<attribute name="Specification-Vendor" value="Adempiere.org"/>
<attribute name="Implementation-Title" value="CTools ${env.ADEMPIERE_VERSION}${version}"/>
<attribute name="Implementation-Version" value="${env.ADEMPIERE_VERSION}${version} ${DSTAMP}-${TSTAMP}"/>
<attribute name="Implementation-Vendor" value="${env.ADEMPIERE_VENDOR}"/>
<attribute name="Implementation-URL" value="http://www.adempiere.org"/>
</manifest>
</jar>
<copy file="${dist.dir}/${needed.jar.name}.jar" todir="../lib">

View File

@ -3,6 +3,8 @@
*/
package org.compiere.report;
import java.awt.Component;
import java.util.logging.Level;
import net.sf.jasperreports.view.JRViewer;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.JRException;
@ -14,31 +16,57 @@ import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.io.File;
import org.compiere.model.MUser;
import org.compiere.util.CLogger;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import org.compiere.apps.*;
public class JasperReportViewer extends JRViewer {
private static final long serialVersionUID = -7988455595896562947L;
/** Logger */
private static CLogger log = CLogger.getCLogger(JasperReportViewer.class);
private JasperViewer jasperViewer;
private JasperPrint jasperPrint;
private JComboBox comboBox;
public JasperReportViewer(final JasperPrint jasperPrint) throws JRException {
public JasperReportViewer(final JasperViewer jasperViewer, final JasperPrint jasperPrint) throws JRException {
super( jasperPrint);
this.jasperViewer = jasperViewer;
this.jasperPrint = jasperPrint;
JButton btnExport = new JButton();
tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL));
JButton btnSendByEmail = new JButton();
btnSendByEmail.setToolTipText("Send by Email");
btnSendByEmail.setText("Email");
btnSendByEmail.setPreferredSize(new java.awt.Dimension(85, 23));
btnSendByEmail.setMaximumSize(new java.awt.Dimension(85, 23));
btnSendByEmail.setMinimumSize(new java.awt.Dimension(85, 23));
btnSendByEmail.addActionListener( new SendByEmailListener(jasperViewer, this));
tlbToolBar.add(btnSendByEmail);
tlbToolBar.add(new JSeparator(SwingConstants.VERTICAL));
JButton btnExport = new JButton();
btnExport.setToolTipText("Export to");
btnExport.setText("Export to");
btnExport.setPreferredSize(new java.awt.Dimension(70, 23));
btnExport.setMaximumSize(new java.awt.Dimension(70, 23));
btnExport.setMinimumSize(new java.awt.Dimension(70, 23));
btnExport.setText("Export");
btnExport.setPreferredSize(new java.awt.Dimension(85, 23));
btnExport.setMaximumSize(new java.awt.Dimension(85, 23));
btnExport.setMinimumSize(new java.awt.Dimension(85, 23));
btnExport.addActionListener( new ExportListener( this));
// tlbToolBar.addSeparator();
tlbToolBar.add(btnExport);
comboBox = new JComboBox( new String[] {"PDF","HTML", "XLS"});
comboBox.setPreferredSize(new java.awt.Dimension(70, 23));
comboBox.setMaximumSize(new java.awt.Dimension(70, 23));
comboBox.setMinimumSize(new java.awt.Dimension(70, 23));
comboBox = new JComboBox( new String[] {"PDF","HTML", "XLS"});
comboBox.setPreferredSize(new java.awt.Dimension(80, 23));
comboBox.setMaximumSize(new java.awt.Dimension(80, 23));
comboBox.setMinimumSize(new java.awt.Dimension(80, 23));
tlbToolBar.add(comboBox);
// Set default viewer zoom level
btnFitPage.setSelected(true);
setZooms();
}
public JasperPrint getJasperPrint() {
@ -59,6 +87,8 @@ class ExportListener implements ActionListener {
public void actionPerformed(ActionEvent event) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setSelectedFile(new File(viewer.getJasperPrint().getName() +
"." + viewer.getFormat().toLowerCase()));
if (fileChooser.showSaveDialog( viewer)==JFileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
try {
@ -78,3 +108,38 @@ class ExportListener implements ActionListener {
}
}
}
class SendByEmailListener implements ActionListener {
/** Logger */
private static CLogger log = CLogger.getCLogger(SendByEmailListener.class);
private JasperViewer jasperViewer;
private JasperReportViewer viewer;
public SendByEmailListener(JasperViewer jasperViewer, JasperReportViewer viewer) {
this.jasperViewer = jasperViewer;
this.viewer = viewer;
}
public void actionPerformed(ActionEvent event) {
String to = "";
MUser from = MUser.get(Env.getCtx(), Env.getAD_User_ID(Env.getCtx()));
String subject = viewer.getJasperPrint().getName();
String message = "";
File attachment = null;
try
{
attachment = File.createTempFile("mail", ".pdf");
JasperExportManager.exportReportToPdfFile(viewer.getJasperPrint(), attachment.getAbsolutePath());
}
catch (Exception e)
{
log.log(Level.SEVERE, "", e);
}
EMailDialog emd = new EMailDialog ((JFrame)jasperViewer,
Msg.getMsg(Env.getCtx(), "SendMail"),
from, to, subject, message, attachment);
}
}

View File

@ -35,7 +35,7 @@ public class JasperViewer extends javax.swing.JFrame {
protected JasperViewer(JasperPrint jasperPrint,String frameTitle) throws JRException {
this.m_title = frameTitle;
initComponents();
JasperReportViewer viewer = new JasperReportViewer(jasperPrint);
JasperReportViewer viewer = new JasperReportViewer(this, jasperPrint);
this.pnlMain.add(viewer, BorderLayout.CENTER);
}

View File

@ -69,9 +69,9 @@ public class ReportStarter implements ProcessCall {
String reportPath = System.getProperty("org.compiere.report.path");
if (reportPath == null) {
REPORT_HOME = new File( System.getProperty("COMPIERE_HOME")+"/reports");
REPORT_HOME = new File(System.getProperty("ADEMPIERE_HOME") + "./reports");
} else {
REPORT_HOME = new File( reportPath);
REPORT_HOME = new File(reportPath);
}
}
@ -220,7 +220,7 @@ public class ReportStarter implements ProcessCall {
/**
* @author rlemeill
* @param reportLocation http string url ex: http://compiereserver.domain.com/webApp/standalone.jrxml
* @param reportLocation http string url ex: http://adempiereserver.domain.com/webApp/standalone.jrxml
* @return downloaded File (or already existing one)
*/
private File httpDownloadedReport(String reportLocation)
@ -324,6 +324,7 @@ public class ReportStarter implements ProcessCall {
if (Record_ID!=-1) {
JasperData data = null;
File reportFile = null;
String fileExtension = "";
HashMap params = new HashMap( ctx);
addProcessParameters( AD_PInstance_ID, params, trxName);
@ -343,9 +344,15 @@ public class ReportStarter implements ProcessCall {
}
if (reportFile != null)
{
data = processReport(reportFile);
fileExtension = reportFile.getName().substring(reportFile.getName().lastIndexOf("."),
reportFile.getName().length());
}
else
{
return false;
}
JasperReport jasperReport = data.getJasperReport();
String jasperName = data.getJasperName();
@ -354,7 +361,7 @@ public class ReportStarter implements ProcessCall {
if (jasperReport != null) {
// Subreports
File[] subreports = reportDir.listFiles( new FileFilter( jasperName+"Subreport", reportDir, ".xml"));
File[] subreports = reportDir.listFiles( new FileFilter( jasperName+"Subreport", reportDir, fileExtension));
for( int i=0; i<subreports.length; i++) {
JasperData subData = processReport( subreports[i]);
if (subData.getJasperReport()!=null) {
@ -402,10 +409,11 @@ public class ReportStarter implements ProcessCall {
JasperPrintManager.printReport( jasperPrint, false);
// You can use JasperPrint to create PDF
JasperExportManager.exportReportToPdfFile(jasperPrint, "BasicReport.pdf");
// JasperExportManager.exportReportToPdfFile(jasperPrint, "BasicReport.pdf");
} else {
log.info( "ReportStarter.startProcess run report -"+jasperPrint.getName());
JasperViewer jasperViewer = new JasperViewer( jasperPrint, pi.getTitle()+" - " + reportPath);
jasperViewer.setExtendedState(jasperViewer.getExtendedState() | javax.swing.JFrame.MAXIMIZED_BOTH);
jasperViewer.setVisible(true);
}
} catch (JRException e) {
@ -446,12 +454,15 @@ public class ReportStarter implements ProcessCall {
// Reports deployement on web server Thanks to Alin Vaida
if (reportPath.startsWith("http://")) {
reportFile = httpDownloadedReport(reportPath);
} else if(reportPath.startsWith("/")) {
reportFile = new File(reportPath);
} else {
reportFile = new File(REPORT_HOME, reportPath);
}
// Set org.compiere.report.path because it is used in reports which refer to subreports
System.setProperty("org.compiere.report.path", reportFile.getParentFile().getAbsolutePath());
return reportFile;
}
@ -588,8 +599,8 @@ public class ReportStarter implements ProcessCall {
compiereJasperAbsolutePath = compiereJasperAbsolutePath.replaceAll("%20"," ");
jasperreportsAbsolutePath = jasperreportsAbsolutePath.replaceAll("%20"," ");
String newClassPath = jasperreportsAbsolutePath + System.getProperty("path.separator") + compiereJasperAbsolutePath;
log.warning("JasperReports compilation is probably started from JavaWebStart");
log.info("classpath is corrected to "+newClassPath);
log.info("JasperReports compilation is probably started from JavaWebStart");
log.info("Classpath is corrected to "+newClassPath);
System.setProperty("java.class.path",newClassPath) ;
}

View File

@ -34,7 +34,7 @@
<target name="xdoclet">
<echo>------ Executing xdoclet</echo>
<ant inheritall="false" antfile="xdoclet-build.xml"/>
<!--<ant inheritall="false" antfile="xdoclet-build.xml"/>-->
</target>
<target name="packaging">

View File

@ -107,7 +107,7 @@ public class ProcessCtl extends Thread
}
// execute
ProcessCtl worker = new ProcessCtl(parent, pi, trx);
ProcessCtl worker = new ProcessCtl(parent, WindowNo, pi, trx);
worker.start(); // MUST be start!
return worker;
} // execute
@ -171,7 +171,7 @@ public class ProcessCtl extends Thread
}
// execute
ProcessCtl worker = new ProcessCtl(parent, pi, trx);
ProcessCtl worker = new ProcessCtl(parent, WindowNo, pi, trx);
worker.start(); // MUST be start!
return worker;
} // execute
@ -185,13 +185,16 @@ public class ProcessCtl extends Thread
* @param trx Transaction
* Created in process(), VInvoiceGen.generateInvoices
*/
public ProcessCtl (ASyncProcess parent, ProcessInfo pi, Trx trx)
public ProcessCtl (ASyncProcess parent, int WindowNo, ProcessInfo pi, Trx trx)
{
windowno = WindowNo;
m_parent = parent;
m_pi = pi;
m_trx = trx; // handeled correctly
} // ProcessCtl
/** Windowno */
int windowno;
/** Parenr */
ASyncProcess m_parent;
/** Process Info */
@ -360,7 +363,7 @@ public class ProcessCtl extends Thread
} // Pre-Report
// Start Report -----------------------------------------------
boolean ok = ReportCtl.start(m_pi, IsDirectPrint);
boolean ok = ReportCtl.start(m_parent, windowno, m_pi, IsDirectPrint);
m_pi.setSummary("Report", !ok);
unlock ();
}

View File

@ -379,7 +379,7 @@ public class ProcessDialog extends CFrame
for (int i = 0; i < m_ids.length; i++)
{
int M_InOut_ID = m_ids[i];
ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, true);
ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, this, Env.getWindowNo(this), true);
}
ADialogDialog d = new ADialogDialog (this,
Env.getHeader(Env.getCtx(), m_WindowNo),
@ -408,7 +408,7 @@ public class ProcessDialog extends CFrame
for (int i = 0; i < m_ids.length; i++)
{
int AD_Invoice_ID = m_ids[i];
ReportCtl.startDocumentPrint(ReportEngine.INVOICE, AD_Invoice_ID, true);
ReportCtl.startDocumentPrint(ReportEngine.INVOICE, AD_Invoice_ID, this, Env.getWindowNo(this), true);
}
ADialogDialog d = new ADialogDialog (this,
Env.getHeader(Env.getCtx(), m_WindowNo),

View File

@ -459,7 +459,7 @@ public class VInOutGen extends CPanel
}
// Execute Process
ProcessCtl worker = new ProcessCtl(this, pi, trx);
ProcessCtl worker = new ProcessCtl(this, Env.getWindowNo(this), pi, trx);
worker.start(); // complete tasks in unlockUI / generateShipments_complete
//
} // generateShipments
@ -508,7 +508,7 @@ public class VInOutGen extends CPanel
for (int i = 0; i < ids.length; i++)
{
int M_InOut_ID = ids[i];
ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, true);
ReportCtl.startDocumentPrint(ReportEngine.SHIPMENT, M_InOut_ID, this, Env.getWindowNo(this), true);
}
ADialogDialog d = new ADialogDialog (m_frame,
Env.getHeader(Env.getCtx(), m_WindowNo),

View File

@ -451,7 +451,7 @@ public class VInvoiceGen extends CPanel
}
// Execute Process
ProcessCtl worker = new ProcessCtl(this, pi, trx);
ProcessCtl worker = new ProcessCtl(this, Env.getWindowNo(this), pi, trx);
worker.start(); // complete tasks in unlockUI / generateInvoice_complete
} // generateInvoices
@ -498,7 +498,7 @@ public class VInvoiceGen extends CPanel
for (int i = 0; i < ids.length; i++)
{
int C_Invoice_ID = ids[i];
ReportCtl.startDocumentPrint(ReportEngine.INVOICE, C_Invoice_ID, true);
ReportCtl.startDocumentPrint(ReportEngine.INVOICE, C_Invoice_ID, this, Env.getWindowNo(this), true);
}
ADialogDialog d = new ADialogDialog (m_frame,
Env.getHeader(Env.getCtx(), m_WindowNo),

View File

@ -1,8 +1,8 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
@ -42,13 +42,13 @@ public class VPayPrint extends CPanel
* Initialize Panel
* @param WindowNo window
* @param frame frame
*/
public void init (int WindowNo, FormFrame frame)
{
log.info("");
m_WindowNo = WindowNo;
m_frame = frame;
try
*/
public void init (int WindowNo, FormFrame frame)
{
log.info("");
m_WindowNo = WindowNo;
m_frame = frame;
try
{
jbInit();
dynInit();
@ -437,14 +437,14 @@ public class VPayPrint extends CPanel
ADialog.info(m_WindowNo, this, "Saved",
fc.getSelectedFile().getAbsolutePath() + "\n"
+ Msg.getMsg(Env.getCtx(), "NoOfLines") + "=" + no);
if (ADialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
{
// int lastDocumentNo =
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
// document No not updated
}
dispose();
if (ADialog.ask(m_WindowNo, this, "VPayPrintSuccess?"))
{
// int lastDocumentNo =
MPaySelectionCheck.confirmPrint (m_checks, m_batch);
// document No not updated
}
dispose();
} // cmd_export
/**
@ -466,19 +466,19 @@ public class VPayPrint extends CPanel
{
String PaymentRule = ((ValueNamePair)fPaymentRule.getSelectedItem()).getValue();
log.info(PaymentRule);
if (!getChecks(PaymentRule))
return;
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
boolean somethingPrinted = false;
if (!getChecks(PaymentRule))
return;
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
boolean somethingPrinted = false;
boolean directPrint = !Ini.isPropertyBool(Ini.P_PRINTPREVIEW);
// for all checks
for (int i = 0; i < m_checks.length; i++)
{
MPaySelectionCheck check = m_checks[i];
// ReportCtrl will check BankAccountDoc for PrintFormat
boolean ok = ReportCtl.startDocumentPrint(ReportEngine.CHECK, check.get_ID(), directPrint);
boolean ok = ReportCtl.startDocumentPrint(ReportEngine.CHECK, check.get_ID(), null, Env.getWindowNo(this), directPrint);
if (!somethingPrinted && ok)
somethingPrinted = true;
}
@ -502,7 +502,7 @@ public class VPayPrint extends CPanel
for (int i = 0; i < m_checks.length; i++)
{
MPaySelectionCheck check = m_checks[i];
ReportCtl.startDocumentPrint(ReportEngine.REMITTANCE, check.get_ID(), directPrint);
ReportCtl.startDocumentPrint(ReportEngine.REMITTANCE, check.get_ID(), null, Env.getWindowNo(this), directPrint);
}
} // remittance
@ -532,13 +532,13 @@ public class VPayPrint extends CPanel
int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue();
log.config("C_PaySelection_ID=" + C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo);
//
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// get Slecetions
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
this.setCursor(Cursor.getDefaultCursor());
//
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// get Slecetions
m_checks = MPaySelectionCheck.get(C_PaySelection_ID, PaymentRule, startDocumentNo, null);
this.setCursor(Cursor.getDefaultCursor());
//
if (m_checks == null || m_checks.length == 0)
{

View File

@ -35,7 +35,7 @@ import org.compiere.util.*;
*
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © Jorg Janke
* *Copyright <EFBFBD> Jorg Janke
* @version $Id: SubCheckout.java,v 1.1 2004/07/12 04:10:04 jjanke Exp $
*/
public class SubCheckout extends PosSubPanel implements ActionListener
@ -159,8 +159,8 @@ public class SubCheckout extends PosSubPanel implements ActionListener
//TODO: Credit card
/* Panel para la introducción de los datos de CreditCard para el pago quitada por ConSerTi al no considerar
* que sea útil de momento
/* Panel para la introducci<EFBFBD>n de los datos de CreditCard para el pago quitada por ConSerTi al no considerar
* que sea <EFBFBD>til de momento
// -- 1 -- Creditcard
CPanel creditcard = new CPanel(new GridBagLayout());
@ -307,7 +307,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
* Process Order
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © ConSerTi
* *Copyright <EFBFBD> ConSerTi
*/
public void processOrder()
{
@ -332,7 +332,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
* Print Ticket
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © ConSerTi
* *Copyright <EFBFBD> ConSerTi
*/
public void printTicket()
{
@ -342,7 +342,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
if (order != null)
{
try
try
{
//TODO: to incorporate work from Posterita
/*
@ -350,7 +350,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
PrintLabel.printLabelTicket(order.getC_Order_ID(), p_pos.getAD_PrintLabel_ID());
*/
//print standard document
ReportCtl.startDocumentPrint(ReportEngine.ORDER, order.getC_Order_ID(), true);
ReportCtl.startDocumentPrint(ReportEngine.ORDER, order.getC_Order_ID(), null, Env.getWindowNo(this), true);
}
catch (Exception e)
{
@ -364,7 +364,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
* Display the difference between tender amount and bill amount
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © ConSerTi
* *Copyright <EFBFBD> ConSerTi
*/
public void displayReturn()
{
@ -386,7 +386,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
*
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © ConSerTi
* *Copyright <EFBFBD> ConSerTi
*/
public boolean isOrderFullyPay()
{
@ -409,7 +409,7 @@ public class SubCheckout extends PosSubPanel implements ActionListener
* Abre la caja registradora
* @author Comunidad de Desarrollo OpenXpertya
* *Basado en Codigo Original Modificado, Revisado y Optimizado de:
* *Copyright © ConSerTi
* *Copyright <EFBFBD> ConSerTi
*/
public void openCashDrawer()
{
@ -438,12 +438,12 @@ public class SubCheckout extends PosSubPanel implements ActionListener
byte data[] = new byte[5];
data[0] = 27;
data[1] = 112;
data[2] = 0;
data[3] = 50;
data[2] = 0;
data[3] = 50;
data[4] = 50;
FileOutputStream fos = new FileOutputStream(puerto);
BufferedOutputStream bos = new BufferedOutputStream(fos);
bos.write(data, 0, data.length);
bos.write(data, 0, data.length);
bos.close();
fos.close();
}

View File

@ -52,7 +52,7 @@ public class ReportCtl
* @param IsDirectPrint if true, prints directly - otherwise View
* @return true if created
*/
static public boolean start (ProcessInfo pi, boolean IsDirectPrint)
static public boolean start (ASyncProcess parent, int WindowNo, ProcessInfo pi, boolean IsDirectPrint)
{
s_log.info("start - " + pi);
@ -60,19 +60,19 @@ public class ReportCtl
* Order Print
*/
if (pi.getAD_Process_ID() == 110) // C_Order
return startDocumentPrint(ReportEngine.ORDER, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.ORDER, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 116) // C_Invoice
return startDocumentPrint(ReportEngine.INVOICE, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.INVOICE, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 117) // M_InOut
return startDocumentPrint(ReportEngine.SHIPMENT, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.SHIPMENT, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 217) // C_Project
return startDocumentPrint(ReportEngine.PROJECT, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.PROJECT, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 276) // C_RfQResponse
return startDocumentPrint(ReportEngine.RFQ, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.RFQ, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 313) // C_Payment
return startCheckPrint(pi.getRecord_ID(), IsDirectPrint);
else if (pi.getAD_Process_ID() == 290) // Movement Submission by VHARCQ
return startDocumentPrint(ReportEngine.MOVEMENT, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.MOVEMENT, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
/**
else if (pi.AD_Process_ID == 9999999) // PaySelection
return startDocumentPrint(CHECK, pi, IsDirectPrint);
@ -80,7 +80,7 @@ public class ReportCtl
return startDocumentPrint(REMITTANCE, pi, IsDirectPrint);
**/
else if (pi.getAD_Process_ID() == 159) // Dunning
return startDocumentPrint(ReportEngine.DUNNING, pi.getRecord_ID(), IsDirectPrint);
return startDocumentPrint(ReportEngine.DUNNING, pi.getRecord_ID(), parent, WindowNo, IsDirectPrint);
else if (pi.getAD_Process_ID() == 202 // Financial Report
|| pi.getAD_Process_ID() == 204) // Financial Statement
return startFinReport (pi);
@ -153,23 +153,37 @@ public class ReportCtl
* @param IsDirectPrint if true, prints directly - otherwise View
* @return true if success
*/
public static boolean startDocumentPrint (int type, int Record_ID, boolean IsDirectPrint)
public static boolean startDocumentPrint (int type, int Record_ID, ASyncProcess parent, int WindowNo, boolean IsDirectPrint)
{
ReportEngine re = ReportEngine.get (Env.getCtx(), type, Record_ID);
if (re == null)
{
ADialog.error(0, null, "NoDocPrintFormat");
return false;
}
if (IsDirectPrint)
if(re.getPrintFormat() != null && re.getPrintFormat().getJasperProcess_ID() > 0)
{
re.print ();
ReportEngine.printConfirm (type, Record_ID);
ProcessInfo pi = new ProcessInfo ("", re.getPrintFormat().getJasperProcess_ID());
// Execute Process
ProcessCtl worker = ProcessCtl.process(parent, WindowNo, pi, null);
try {
worker.start();
} catch(java.lang.IllegalThreadStateException itse) {
// Do nothing
}
}
else
preview(re);
{
if (IsDirectPrint)
{
re.print ();
ReportEngine.printConfirm (type, Record_ID);
}
else
preview(re);
}
//vpj-cd e-evolution 15022007
if(type == ReportEngine.INVOICE)
@ -203,7 +217,7 @@ public class ReportCtl
return true;
} // StartDocumentPrint
/**
* Start Check Print.
* Find/Create
@ -223,7 +237,7 @@ public class ReportCtl
if (psc != null)
C_PaySelectionCheck_ID = psc.getC_PaySelectionCheck_ID();
}
return startDocumentPrint (ReportEngine.CHECK, C_PaySelectionCheck_ID, IsDirectPrint);
return startDocumentPrint (ReportEngine.CHECK, C_PaySelectionCheck_ID, null, -1, IsDirectPrint);
} // startCheckPrint
private static void preview(ReportEngine re) {

View File

@ -1,381 +1,436 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program is free software;
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
* This program is free software;
you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY;
* that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program;
* 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 *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.compiere.model;
package org.compiere.model;
/** Generated Model - DO NOT CHANGE */
import java.util.*;
import java.sql.*;
import java.math.*;
import org.compiere.util.*;
import java.util.*;
import java.sql.*;
import java.math.*;
import org.compiere.util.*;
/** Generated Model for AD_PrintFormat
* @author Adempiere (generated)
* @version Release 3.1.4 - $Id$ */
public class X_AD_PrintFormat extends PO
{
public class X_AD_PrintFormat extends PO
{
/** Standard Constructor
@param ctx context
@param AD_PrintFormat_ID id
@param trxName transaction
*/
public X_AD_PrintFormat (Properties ctx, int AD_PrintFormat_ID, String trxName)
{
super (ctx, AD_PrintFormat_ID, trxName);
/** if (AD_PrintFormat_ID == 0)
{
setAD_PrintColor_ID (0);
setAD_PrintFont_ID (0);
setAD_PrintFormat_ID (0); // 0
setAD_PrintPaper_ID (0);
setAD_Table_ID (0);
setFooterMargin (0);
setHeaderMargin (0);
setIsDefault (false);
setIsForm (false);
setIsStandardHeaderFooter (true); // Y
setIsTableBased (true); // Y
setName (null);
}
public X_AD_PrintFormat (Properties ctx, int AD_PrintFormat_ID, String trxName)
{
super (ctx, AD_PrintFormat_ID, trxName);
/** if (AD_PrintFormat_ID == 0)
{
setAD_PrintColor_ID (0);
setAD_PrintFont_ID (0);
setAD_PrintFormat_ID (0); // 0
setAD_PrintPaper_ID (0);
setAD_Table_ID (0);
setFooterMargin (0);
setHeaderMargin (0);
setIsDefault (false);
setIsForm (false);
setIsStandardHeaderFooter (true); // Y
setIsTableBased (true); // Y
setName (null);
}
*/
}
}
/** Load Constructor
@param ctx context
@param rs result set
@param trxName transaction
*/
public X_AD_PrintFormat (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
public X_AD_PrintFormat (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AD_Table_ID=493 */
public static final int Table_ID=MTable.getTable_ID("AD_PrintFormat");
public static final int Table_ID=MTable.getTable_ID("AD_PrintFormat");
/** TableName=AD_PrintFormat */
public static final String Table_Name="AD_PrintFormat";
public static final String Table_Name="AD_PrintFormat";
protected static KeyNamePair Model = new KeyNamePair(Table_ID,"AD_PrintFormat");
protected static KeyNamePair Model = new KeyNamePair(Table_ID,"AD_PrintFormat");
protected BigDecimal accessLevel = BigDecimal.valueOf(7);
protected BigDecimal accessLevel = BigDecimal.valueOf(7);
/** AccessLevel
@return 7 - System - Client - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID);
return poi;
}
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public String toString()
{
StringBuffer sb = new StringBuffer ("X_AD_PrintFormat[").append(get_ID()).append("]");
return sb.toString();
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_AD_PrintFormat[").append(get_ID()).append("]");
return sb.toString();
}
/** Set Print Color.
@param AD_PrintColor_ID Color used for printing and display */
public void setAD_PrintColor_ID (int AD_PrintColor_ID)
{
if (AD_PrintColor_ID < 1) throw new IllegalArgumentException ("AD_PrintColor_ID is mandatory.");
set_Value ("AD_PrintColor_ID", Integer.valueOf(AD_PrintColor_ID));
}
public void setAD_PrintColor_ID (int AD_PrintColor_ID)
{
if (AD_PrintColor_ID < 1) throw new IllegalArgumentException ("AD_PrintColor_ID is mandatory.");
set_Value ("AD_PrintColor_ID", Integer.valueOf(AD_PrintColor_ID));
}
/** Get Print Color.
@return Color used for printing and display */
public int getAD_PrintColor_ID()
{
Integer ii = (Integer)get_Value("AD_PrintColor_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_PrintColor_ID()
{
Integer ii = (Integer)get_Value("AD_PrintColor_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_PrintColor_ID */
public static final String COLUMNNAME_AD_PrintColor_ID = "AD_PrintColor_ID";
/** Set Print Font.
@param AD_PrintFont_ID Maintain Print Font */
public void setAD_PrintFont_ID (int AD_PrintFont_ID)
{
if (AD_PrintFont_ID < 1) throw new IllegalArgumentException ("AD_PrintFont_ID is mandatory.");
set_Value ("AD_PrintFont_ID", Integer.valueOf(AD_PrintFont_ID));
}
public void setAD_PrintFont_ID (int AD_PrintFont_ID)
{
if (AD_PrintFont_ID < 1) throw new IllegalArgumentException ("AD_PrintFont_ID is mandatory.");
set_Value ("AD_PrintFont_ID", Integer.valueOf(AD_PrintFont_ID));
}
/** Get Print Font.
@return Maintain Print Font */
public int getAD_PrintFont_ID()
{
Integer ii = (Integer)get_Value("AD_PrintFont_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_PrintFont_ID()
{
Integer ii = (Integer)get_Value("AD_PrintFont_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_PrintFont_ID */
public static final String COLUMNNAME_AD_PrintFont_ID = "AD_PrintFont_ID";
/** Set Print Format.
@param AD_PrintFormat_ID Data Print Format */
public void setAD_PrintFormat_ID (int AD_PrintFormat_ID)
{
if (AD_PrintFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintFormat_ID is mandatory.");
set_ValueNoCheck ("AD_PrintFormat_ID", Integer.valueOf(AD_PrintFormat_ID));
}
public void setAD_PrintFormat_ID (int AD_PrintFormat_ID)
{
if (AD_PrintFormat_ID < 1) throw new IllegalArgumentException ("AD_PrintFormat_ID is mandatory.");
set_ValueNoCheck ("AD_PrintFormat_ID", Integer.valueOf(AD_PrintFormat_ID));
}
/** Get Print Format.
@return Data Print Format */
public int getAD_PrintFormat_ID()
{
Integer ii = (Integer)get_Value("AD_PrintFormat_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_PrintFormat_ID()
{
Integer ii = (Integer)get_Value("AD_PrintFormat_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_PrintFormat_ID */
public static final String COLUMNNAME_AD_PrintFormat_ID = "AD_PrintFormat_ID";
/** Set Print Paper.
@param AD_PrintPaper_ID Printer paper definition */
public void setAD_PrintPaper_ID (int AD_PrintPaper_ID)
{
if (AD_PrintPaper_ID < 1) throw new IllegalArgumentException ("AD_PrintPaper_ID is mandatory.");
set_Value ("AD_PrintPaper_ID", Integer.valueOf(AD_PrintPaper_ID));
}
public void setAD_PrintPaper_ID (int AD_PrintPaper_ID)
{
if (AD_PrintPaper_ID < 1) throw new IllegalArgumentException ("AD_PrintPaper_ID is mandatory.");
set_Value ("AD_PrintPaper_ID", Integer.valueOf(AD_PrintPaper_ID));
}
/** Get Print Paper.
@return Printer paper definition */
public int getAD_PrintPaper_ID()
{
Integer ii = (Integer)get_Value("AD_PrintPaper_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_PrintPaper_ID()
{
Integer ii = (Integer)get_Value("AD_PrintPaper_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_PrintPaper_ID */
public static final String COLUMNNAME_AD_PrintPaper_ID = "AD_PrintPaper_ID";
/** Set Print Table Format.
@param AD_PrintTableFormat_ID Table Format in Reports */
public void setAD_PrintTableFormat_ID (int AD_PrintTableFormat_ID)
{
if (AD_PrintTableFormat_ID <= 0) set_Value ("AD_PrintTableFormat_ID", null);
public void setAD_PrintTableFormat_ID (int AD_PrintTableFormat_ID)
{
if (AD_PrintTableFormat_ID <= 0) set_Value ("AD_PrintTableFormat_ID", null);
else
set_Value ("AD_PrintTableFormat_ID", Integer.valueOf(AD_PrintTableFormat_ID));
}
set_Value ("AD_PrintTableFormat_ID", Integer.valueOf(AD_PrintTableFormat_ID));
}
/** Get Print Table Format.
@return Table Format in Reports */
public int getAD_PrintTableFormat_ID()
{
Integer ii = (Integer)get_Value("AD_PrintTableFormat_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_PrintTableFormat_ID()
{
Integer ii = (Integer)get_Value("AD_PrintTableFormat_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_PrintTableFormat_ID */
public static final String COLUMNNAME_AD_PrintTableFormat_ID = "AD_PrintTableFormat_ID";
/** Set Report View.
@param AD_ReportView_ID View used to generate this report */
public void setAD_ReportView_ID (int AD_ReportView_ID)
{
if (AD_ReportView_ID <= 0) set_ValueNoCheck ("AD_ReportView_ID", null);
public void setAD_ReportView_ID (int AD_ReportView_ID)
{
if (AD_ReportView_ID <= 0) set_ValueNoCheck ("AD_ReportView_ID", null);
else
set_ValueNoCheck ("AD_ReportView_ID", Integer.valueOf(AD_ReportView_ID));
}
set_ValueNoCheck ("AD_ReportView_ID", Integer.valueOf(AD_ReportView_ID));
}
/** Get Report View.
@return View used to generate this report */
public int getAD_ReportView_ID()
{
Integer ii = (Integer)get_Value("AD_ReportView_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_ReportView_ID()
{
Integer ii = (Integer)get_Value("AD_ReportView_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_ReportView_ID */
public static final String COLUMNNAME_AD_ReportView_ID = "AD_ReportView_ID";
/** Set Table.
@param AD_Table_ID Database Table information */
public void setAD_Table_ID (int AD_Table_ID)
{
if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory.");
set_ValueNoCheck ("AD_Table_ID", Integer.valueOf(AD_Table_ID));
}
public void setAD_Table_ID (int AD_Table_ID)
{
if (AD_Table_ID < 1) throw new IllegalArgumentException ("AD_Table_ID is mandatory.");
set_ValueNoCheck ("AD_Table_ID", Integer.valueOf(AD_Table_ID));
}
/** Get Table.
@return Database Table information */
public int getAD_Table_ID()
{
Integer ii = (Integer)get_Value("AD_Table_ID");
if (ii == null) return 0;
return ii.intValue();
}
public int getAD_Table_ID()
{
Integer ii = (Integer)get_Value("AD_Table_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name AD_Table_ID */
public static final String COLUMNNAME_AD_Table_ID = "AD_Table_ID";
/** Set Create Copy.
@param CreateCopy Create Copy */
public void setCreateCopy (String CreateCopy)
{
if (CreateCopy != null && CreateCopy.length() > 1)
{
log.warning("Length > 1 - truncated");
CreateCopy = CreateCopy.substring(0,0);
}
set_Value ("CreateCopy", CreateCopy);
}
public void setCreateCopy (String CreateCopy)
{
if (CreateCopy != null && CreateCopy.length() > 1)
{
log.warning("Length > 1 - truncated");
CreateCopy = CreateCopy.substring(0,0);
}
set_Value ("CreateCopy", CreateCopy);
}
/** Get Create Copy.
@return Create Copy */
public String getCreateCopy()
{
return (String)get_Value("CreateCopy");
}
public String getCreateCopy()
{
return (String)get_Value("CreateCopy");
}
/** Column name CreateCopy */
public static final String COLUMNNAME_CreateCopy = "CreateCopy";
/** Set Description.
@param Description Optional short description of the record */
public void setDescription (String Description)
{
if (Description != null && Description.length() > 255)
{
log.warning("Length > 255 - truncated");
Description = Description.substring(0,254);
}
set_Value ("Description", Description);
}
public void setDescription (String Description)
{
if (Description != null && Description.length() > 255)
{
log.warning("Length > 255 - truncated");
Description = Description.substring(0,254);
}
set_Value ("Description", Description);
}
/** Get Description.
@return Optional short description of the record */
public String getDescription()
{
return (String)get_Value("Description");
}
public String getDescription()
{
return (String)get_Value("Description");
}
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Footer Margin.
@param FooterMargin Margin of the Footer in 1/72 of an inch */
public void setFooterMargin (int FooterMargin)
{
set_Value ("FooterMargin", Integer.valueOf(FooterMargin));
}
public void setFooterMargin (int FooterMargin)
{
set_Value ("FooterMargin", Integer.valueOf(FooterMargin));
}
/** Get Footer Margin.
@return Margin of the Footer in 1/72 of an inch */
public int getFooterMargin()
{
Integer ii = (Integer)get_Value("FooterMargin");
if (ii == null) return 0;
return ii.intValue();
}
public int getFooterMargin()
{
Integer ii = (Integer)get_Value("FooterMargin");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name FooterMargin */
public static final String COLUMNNAME_FooterMargin = "FooterMargin";
/** Set Header Margin.
@param HeaderMargin Margin of the Header in 1/72 of an inch */
public void setHeaderMargin (int HeaderMargin)
{
set_Value ("HeaderMargin", Integer.valueOf(HeaderMargin));
}
public void setHeaderMargin (int HeaderMargin)
{
set_Value ("HeaderMargin", Integer.valueOf(HeaderMargin));
}
/** Get Header Margin.
@return Margin of the Header in 1/72 of an inch */
public int getHeaderMargin()
{
Integer ii = (Integer)get_Value("HeaderMargin");
if (ii == null) return 0;
return ii.intValue();
}
public int getHeaderMargin()
{
Integer ii = (Integer)get_Value("HeaderMargin");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name HeaderMargin */
public static final String COLUMNNAME_HeaderMargin = "HeaderMargin";
/** Set Default.
@param IsDefault Default value */
public void setIsDefault (boolean IsDefault)
{
set_Value ("IsDefault", Boolean.valueOf(IsDefault));
}
public void setIsDefault (boolean IsDefault)
{
set_Value ("IsDefault", Boolean.valueOf(IsDefault));
}
/** Get Default.
@return Default value */
public boolean isDefault()
{
Object oo = get_Value("IsDefault");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
public boolean isDefault()
{
Object oo = get_Value("IsDefault");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Column name IsDefault */
public static final String COLUMNNAME_IsDefault = "IsDefault";
/** Set Form.
@param IsForm If Selected, a Form is printed, if not selected a columnar List report */
public void setIsForm (boolean IsForm)
{
set_Value ("IsForm", Boolean.valueOf(IsForm));
}
public void setIsForm (boolean IsForm)
{
set_Value ("IsForm", Boolean.valueOf(IsForm));
}
/** Get Form.
@return If Selected, a Form is printed, if not selected a columnar List report */
public boolean isForm()
{
Object oo = get_Value("IsForm");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
public boolean isForm()
{
Object oo = get_Value("IsForm");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Column name IsForm */
public static final String COLUMNNAME_IsForm = "IsForm";
/** Set Standard Header/Footer.
@param IsStandardHeaderFooter The standard Header and Footer is used */
public void setIsStandardHeaderFooter (boolean IsStandardHeaderFooter)
{
set_Value ("IsStandardHeaderFooter", Boolean.valueOf(IsStandardHeaderFooter));
}
public void setIsStandardHeaderFooter (boolean IsStandardHeaderFooter)
{
set_Value ("IsStandardHeaderFooter", Boolean.valueOf(IsStandardHeaderFooter));
}
/** Get Standard Header/Footer.
@return The standard Header and Footer is used */
public boolean isStandardHeaderFooter()
{
Object oo = get_Value("IsStandardHeaderFooter");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
public boolean isStandardHeaderFooter()
{
Object oo = get_Value("IsStandardHeaderFooter");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Column name IsStandardHeaderFooter */
public static final String COLUMNNAME_IsStandardHeaderFooter = "IsStandardHeaderFooter";
/** Set Table Based.
@param IsTableBased Table based List Reporting */
public void setIsTableBased (boolean IsTableBased)
{
set_ValueNoCheck ("IsTableBased", Boolean.valueOf(IsTableBased));
}
public void setIsTableBased (boolean IsTableBased)
{
set_ValueNoCheck ("IsTableBased", Boolean.valueOf(IsTableBased));
}
/** Get Table Based.
@return Table based List Reporting */
public boolean isTableBased()
{
Object oo = get_Value("IsTableBased");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
public boolean isTableBased()
{
Object oo = get_Value("IsTableBased");
if (oo != null)
{
if (oo instanceof Boolean) return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Column name IsTableBased */
public static final String COLUMNNAME_IsTableBased = "IsTableBased";
/** JasperProcess_ID AD_Reference_ID=400 */
public static final int JASPERPROCESS_ID_AD_Reference_ID=400;
/** Set Jasper Process.
@param JasperProcess_ID The Jasper Process used by the printengine if any process defined */
public void setJasperProcess_ID (int JasperProcess_ID)
{
if (JasperProcess_ID <= 0) set_Value ("JasperProcess_ID", null);
else
set_Value ("JasperProcess_ID", Integer.valueOf(JasperProcess_ID));
}
/** Get Jasper Process.
@return The Jasper Process used by the printengine if any process defined */
public int getJasperProcess_ID()
{
Integer ii = (Integer)get_Value("JasperProcess_ID");
if (ii == null) return 0;
return ii.intValue();
}
/** Column name JasperProcess_ID */
public static final String COLUMNNAME_JasperProcess_ID = "JasperProcess_ID";
/** Set Name.
@param Name Alphanumeric identifier of the entity */
public void setName (String Name)
{
if (Name == null) throw new IllegalArgumentException ("Name is mandatory.");
if (Name.length() > 60)
{
log.warning("Length > 60 - truncated");
Name = Name.substring(0,59);
}
set_Value ("Name", Name);
}
public void setName (String Name)
{
if (Name == null) throw new IllegalArgumentException ("Name is mandatory.");
if (Name.length() > 60)
{
log.warning("Length > 60 - truncated");
Name = Name.substring(0,59);
}
set_Value ("Name", Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity */
public String getName()
{
return (String)get_Value("Name");
}
public String getName()
{
return (String)get_Value("Name");
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
*/public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Printer Name.
@param PrinterName Name of the Printer */
public void setPrinterName (String PrinterName)
{
if (PrinterName != null && PrinterName.length() > 40)
{
log.warning("Length > 40 - truncated");
PrinterName = PrinterName.substring(0,39);
}
set_Value ("PrinterName", PrinterName);
}
public void setPrinterName (String PrinterName)
{
if (PrinterName != null && PrinterName.length() > 40)
{
log.warning("Length > 40 - truncated");
PrinterName = PrinterName.substring(0,39);
}
set_Value ("PrinterName", PrinterName);
}
/** Get Printer Name.
@return Name of the Printer */
public String getPrinterName()
{
return (String)get_Value("PrinterName");
}
}
public String getPrinterName()
{
return (String)get_Value("PrinterName");
}
/** Column name PrinterName */
public static final String COLUMNNAME_PrinterName = "PrinterName";
}

View File

@ -765,7 +765,7 @@ public final class EMail implements Serializable
// Local Character Set
String charSetName = System.getProperty("file.encoding"); // Cp1252
if (charSetName == null || charSetName.length() == 0)
charSetName = "UTF-8"; // WebEnv.ENCODING - alternative iso-8859-1
charSetName = "iso-8859-1"; // WebEnv.ENCODING - alternative iso-8859-1
//
m_msg.setSubject (getSubject(), charSetName);

View File

@ -0,0 +1,106 @@
Insert into "AD_ELEMENT"
("AD_ELEMENT_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY",
"UPDATED","UPDATEDBY","COLUMNNAME","ENTITYTYPE","NAME","PRINTNAME","DESCRIPTION",
"HELP","PO_NAME","PO_PRINTNAME","PO_DESCRIPTION","PO_HELP")
values
(50064,0,0,'Y',to_date('27.02.07','DD.MM.RR'),0,
to_date('27.02.07','DD.MM.RR'),0,'JasperProcess_ID','D',
'Jasper Process','Jasper Process',
'The Jasper Process used by the printengine if any process defined'
,null,null,null,null,null);
Insert into "AD_VAL_RULE"
("AD_VAL_RULE_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY",
"UPDATED","UPDATEDBY","NAME","DESCRIPTION","TYPE","CODE","ENTITYTYPE")
values
(270,0,0,'Y',to_date('27.02.07','DD.MM.RR'),0,to_date('27.02.07','DD.MM.RR'),
0,'AD_Process Jasper Reports',null,'S','AD_Process.JasperReport IS NOT NULL','D');
UPDATE AD_VAL_RULE
SET CODE = 'AD_Process.IsReport=''Y'' AND AD_Process.JasperReport IS NULL'
WHERE NAME = 'AD_Process Reports';
Insert into "AD_REFERENCE"
("AD_REFERENCE_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY",
"UPDATED","UPDATEDBY","NAME","DESCRIPTION","HELP","VALIDATIONTYPE","VFORMAT","ENTITYTYPE")
values
(400,0,0,'Y',to_date('27.02.07','DD.MM.RR'),0,to_date('27.02.07','DD.MM.RR'),
0,'AD_Process_JasperReports',null,null,'T',null,'D');
Insert into "AD_REF_TABLE"
("AD_REFERENCE_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY",
"UPDATED","UPDATEDBY","AD_TABLE_ID","AD_KEY","AD_DISPLAY","ISVALUEDISPLAYED",
"WHERECLAUSE","ORDERBYCLAUSE","ENTITYTYPE")
values
(400,0,0,'Y',to_date('27.02.07','DD.MM.RR'),0,to_date('27.02.07','DD.MM.RR'),
0,284,2801,2809,'N','AD_Process.JasperReport IS NOT NULL',null,'D');
Insert into "AD_COLUMN"
("AD_COLUMN_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","UPDATED",
"CREATEDBY","UPDATEDBY","NAME","DESCRIPTION","HELP","VERSION","ENTITYTYPE",
"COLUMNNAME","AD_TABLE_ID","AD_REFERENCE_ID","AD_REFERENCE_VALUE_ID",
"AD_VAL_RULE_ID","FIELDLENGTH","DEFAULTVALUE","ISKEY","ISPARENT","ISMANDATORY",
"ISUPDATEABLE","READONLYLOGIC","ISIDENTIFIER","SEQNO","ISTRANSLATED","ISENCRYPTED",
"CALLOUT","VFORMAT","VALUEMIN","VALUEMAX","ISSELECTIONCOLUMN","AD_ELEMENT_ID",
"AD_PROCESS_ID","ISSYNCDATABASE","ISALWAYSUPDATEABLE","COLUMNSQL")
values
(50209,0,0,'Y',to_date('27.02.07','DD.MM.RR'),to_date('27.02.07','DD.MM.RR'),0,
0,'Jasper Process','The Jasper Process used by the printengine if any process defined',
null,1,'D','JasperProcess_ID',493,18,400,null,22,null,'N','N','N','Y',null,'N',0,'N',
'N',null,null,null,null,'N',50064,null,'N','N',null);
Insert into "AD_FIELD"
("AD_FIELD_ID","AD_CLIENT_ID","AD_ORG_ID","ISACTIVE","CREATED","CREATEDBY",
"UPDATED","UPDATEDBY","NAME","DESCRIPTION","HELP","ISCENTRALLYMAINTAINED",
"AD_TAB_ID","AD_COLUMN_ID","AD_FIELDGROUP_ID","ISDISPLAYED","DISPLAYLOGIC",
"DISPLAYLENGTH","ISREADONLY","SEQNO","SORTNO","ISSAMELINE","ISHEADING",
"ISFIELDONLY","ISENCRYPTED","ENTITYTYPE","OBSCURETYPE","AD_REFERENCE_ID",
"ISMANDATORY")
values
(50179,0,0,'Y',to_date('27.02.07','DD.MM.RR'),0,to_date('27.02.07','DD.MM.RR'),
0,'Jasper Process','The Jasper Process used by the printengine if any process defined',
null,'Y',425,50209,null,'Y',null,14,'N',195,0,'N','N','N','N','D',null,null,null);
COMMIT;
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_element_id) + 1
FROM ad_element
WHERE ad_element_id < 1000000)
WHERE NAME = 'AD_Element';
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_val_rule_id) + 1
FROM ad_val_rule
WHERE ad_val_rule_id < 1000000)
WHERE NAME = 'AD_Val_Rule';
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_reference_id) + 1
FROM ad_reference
WHERE ad_reference_id < 1000000)
WHERE NAME = 'AD_Reference';
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_reference_id) + 1
FROM ad_ref_table
WHERE ad_reference_id < 1000000)
WHERE NAME = 'AD_Ref_Table';
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_column_id) + 1
FROM ad_column
WHERE ad_column_id < 1000000)
WHERE NAME = 'AD_Column';
UPDATE ad_sequence
SET currentnextsys = (SELECT MAX (ad_field_id) + 1
FROM ad_field
WHERE ad_field_id < 1000000)
WHERE NAME = 'AD_Field';
COMMIT;
ALTER TABLE AD_PrintFormat ADD JasperProcess_ID NUMBER(10);
COMMIT;

View File

@ -23,8 +23,9 @@
<ant inheritAll="false" dir="print"/>
<ant inheritAll="false" dir="base"/>
<ant inheritAll="false" dir="extend"/>
<ant inheritAll="false" dir="JasperReports"/>
<ant inheritAll="false" dir="client"/>
<ant inheritAll="false" dir="JasperReports"/>
<ant inheritAll="false" dir="JasperReportsWebApp"/>
<ant inheritAll="false" dir="serverRoot"/>
<ant inheritAll="false" dir="serverApps"/>
<ant inheritAll="false" dir="webStore"/>
@ -40,6 +41,7 @@
<ant inheritAll="false" dir="base" target="clean"/>
<ant inheritAll="false" dir="extend" target="clean"/>
<ant inheritAll="false" dir="JasperReports" target="clean"/>
<ant inheritAll="false" dir="JasperReportsWebApp" target="clean"/>
<ant inheritAll="false" dir="client" target="clean"/>
<ant inheritAll="false" dir="serverRoot" target="clean"/>
<ant inheritAll="false" dir="serverApps" target="clean"/>