Package org.compiere.print

Examples of org.compiere.print.ReportEngine


   @param file output file
   *  @return file if success
   */
  public File createPDF (File file)
  {
    ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID(), get_TrxName());
    if (re == null)
      return null;
    return re.getPDF(file);
  //  createPDF
View Full Code Here


   @param file output file
   *  @return file if success
   */
  public File createPDF (File file)
  {
    ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.ORDER, getC_Order_ID(), get_TrxName());
    if (re == null)
      return null;
    return re.getPDF(file);
  //  createPDF
View Full Code Here

   @param file output file
   *  @return file if success
   */
  public File createPDF (File file)
  {
    ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.SHIPMENT, getM_InOut_ID(), get_TrxName());
    if (re == null)
      return null;
    return re.getPDF(file);
  //  createPDF
View Full Code Here

          DocumentNo,
          X_C_Invoice.Table_ID,
          C_Invoice_ID,
          C_BPartner_ID);
        info.setCopies(copies);
        ReportEngine re = new ReportEngine(getCtx(), format, query, info);
        boolean printed = false;
        if (p_EMailPDF)
        {
          String subject = mText.getMailHeader() + " - " + DocumentNo;
          EMail email = client.createEMail(to.getEMail(), subject, null);
          if (!email.isValid())
          {
            addLog (C_Invoice_ID, null, null,
              DocumentNo + " @RequestActionEMailError@ Invalid EMail: " + to);
            errors++;
            continue;
          }
          mText.setUser(to);          //  Context
          mText.setBPartner(C_BPartner_ID)//  Context
          mText.setPO(new MInvoice(getCtx(), C_Invoice_ID, get_TrxName()));
          String message = mText.getMailText(true);
          if (mText.isHtml())
            email.setMessageHTML(subject, message);
          else
          {
            email.setSubject (subject);
            email.setMessageText (message);
          }
          //
          File invoice = null;
          if (!Ini.isClient())
            invoice = new File(MInvoice.getPDFFileName(documentDir, C_Invoice_ID));
          File attachment = re.getPDF(invoice);
          log.fine(to + " - " + attachment);
          email.addAttachment(attachment);
          //
          String msg = email.send();
          MUserMail um = new MUserMail(mText, getAD_User_ID(), email);
          um.save();
          if (msg.equals(EMail.SENT_OK))
          {
            addLog (C_Invoice_ID, null, null,
              DocumentNo + " @RequestActionEMailOK@ - " + to.getEMail());
            count++;
            printed = true;
          }
          else
          {
            addLog (C_Invoice_ID, null, null,
              DocumentNo + " @RequestActionEMailError@ " + msg
              + " - " + to.getEMail());
            errors++;
          }
        }
        else
        {
          re.print();
          count++;
          printed = true;
        }
        //  Print Confirm
        if (printed)
View Full Code Here

TOP

Related Classes of org.compiere.print.ReportEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.