Adempiere 3.5.2a

org.compiere.print
Class ReportEngine

java.lang.Object
  extended by org.compiere.print.ReportEngine
All Implemented Interfaces:
PrintServiceAttributeListener

public class ReportEngine
extends Object
implements PrintServiceAttributeListener

Report Engine. For a given PrintFormat, create a Report

Change log:

Version:
$Id: ReportEngine.java,v 1.4 2006/10/08 06:52:51 comdivision Exp $
Author:
Jorg Janke

Field Summary
static int CHECK
          Check = 6
static int DISTRIBUTION_ORDER
          Distribution Order = 9
static int DUNNING
          Dunning = 7
static int INVOICE
          Invoice = 2
static int MANUFACTURING_ORDER
          Manufacturing Order = 8
static int ORDER
          Order = 0
static int PROJECT
          Project = 3
static int REMITTANCE
          Remittance = 5
static int RFQ
          RfQ = 4
static int SHIPMENT
          Shipment = 1
 
Constructor Summary
ReportEngine(Properties ctx, MPrintFormat pf, MQuery query, PrintInfo info)
          Constructor
ReportEngine(Properties ctx, MPrintFormat pf, MQuery query, PrintInfo info, String trxName)
          Constructor
 
Method Summary
 void attributeUpdate(PrintServiceAttributeEvent psae)
          Print Service Attribute Listener.
 boolean createCSV(File file, char delimiter, Language language)
          Create CSV File
 boolean createCSV(Writer writer, char delimiter, Language language)
          Write CSV to writer
 boolean createHTML(File file, boolean onlyTable, Language language)
          Create HTML File
 boolean createHTML(Writer writer, boolean onlyTable, Language language)
          Write HTML to writer
 boolean createPDF(File file)
          Create PDF File
 byte[] createPDFData()
          Create PDF as Data array
 boolean createPS(File file)
          Create PostScript File
 boolean createPS(OutputStream os)
          Write PostScript to writer
 void createXLS(File outFile, Language language)
          Create Excel file
 boolean createXML(File file)
          Create XML File
 boolean createXML(Writer writer)
          Write XML to writer
static ReportEngine get(Properties ctx, int type, int Record_ID)
          Get Document Print Engine for Document Type.
static ReportEngine get(Properties ctx, int type, int Record_ID, String trxName)
          Get Document Print Engine for Document Type.
static ReportEngine get(Properties ctx, ProcessInfo pi)
          Get Report Engine for process info
 int getColumnCount()
          Get Column Count
 Properties getCtx()
          Get PrintLayout (Report) Context
protected  LayoutEngine getLayout()
          Get Layout
 String getName()
          Get PrintFormat (Report) Name
 File getPDF()
          Create PDF file.
 File getPDF(File file)
          Create PDF file.
 PrintData getPrintData()
          Get PrintData
 String getPrinterName()
          Get Printer (name)
 MPrintFormat getPrintFormat()
          Get PrintFormat
 PrintInfo getPrintInfo()
          Get Print Info
 MQuery getQuery()
          Get Query
 int getRowCount()
          Get Row Count
 View getView()
          Get View Panel
static void main(String[] args)
          Test
 void pageSetupDialog()
          Show Dialog and Set Paper Optionally re-calculate layout
 void print()
          Print Report
static void printConfirm(int type, int Record_ID)
          Print Confirm.
 void setPrintData(PrintData printData)
          Set PrintData
 void setPrinterName(String printerName)
          Set Printer (name)
protected  void setPrintFormat(MPrintFormat pf)
          Set PrintFormat.
protected  void setQuery(MQuery query)
          Set Query and generate PrintData.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER

public static final int ORDER
Order = 0

See Also:
Constant Field Values

SHIPMENT

public static final int SHIPMENT
Shipment = 1

See Also:
Constant Field Values

INVOICE

public static final int INVOICE
Invoice = 2

See Also:
Constant Field Values

PROJECT

public static final int PROJECT
Project = 3

See Also:
Constant Field Values

RFQ

public static final int RFQ
RfQ = 4

See Also:
Constant Field Values

REMITTANCE

public static final int REMITTANCE
Remittance = 5

See Also:
Constant Field Values

CHECK

public static final int CHECK
Check = 6

See Also:
Constant Field Values

DUNNING

public static final int DUNNING
Dunning = 7

See Also:
Constant Field Values

MANUFACTURING_ORDER

public static final int MANUFACTURING_ORDER
Manufacturing Order = 8

See Also:
Constant Field Values

DISTRIBUTION_ORDER

public static final int DISTRIBUTION_ORDER
Distribution Order = 9

See Also:
Constant Field Values
Constructor Detail

ReportEngine

public ReportEngine(Properties ctx,
                    MPrintFormat pf,
                    MQuery query,
                    PrintInfo info)
Constructor

Parameters:
ctx - context
pf - Print Format
query - Optional Query
info - print info

ReportEngine

public ReportEngine(Properties ctx,
                    MPrintFormat pf,
                    MQuery query,
                    PrintInfo info,
                    String trxName)
Constructor

Parameters:
ctx - context
pf - Print Format
query - Optional Query
info - print info
trxName -
Method Detail

setPrintFormat

protected void setPrintFormat(MPrintFormat pf)
Set PrintFormat. If Layout was created, re-create layout

Parameters:
pf - print format

setQuery

protected void setQuery(MQuery query)
Set Query and generate PrintData. If Layout was created, re-create layout

Parameters:
query - query

getQuery

public MQuery getQuery()
Get Query

Returns:
query

getPrintData

public PrintData getPrintData()
Get PrintData

Returns:
print data

setPrintData

public void setPrintData(PrintData printData)
Set PrintData

Parameters:
printData - printData

getLayout

protected LayoutEngine getLayout()
Get Layout

Returns:
Layout

getName

public String getName()
Get PrintFormat (Report) Name

Returns:
name

getPrintFormat

public MPrintFormat getPrintFormat()
Get PrintFormat

Returns:
print format

getPrintInfo

public PrintInfo getPrintInfo()
Get Print Info

Returns:
info

getCtx

public Properties getCtx()
Get PrintLayout (Report) Context

Returns:
context

getRowCount

public int getRowCount()
Get Row Count

Returns:
row count

getColumnCount

public int getColumnCount()
Get Column Count

Returns:
column count

getView

public View getView()
Get View Panel

Returns:
view panel

print

public void print()
Print Report


attributeUpdate

public void attributeUpdate(PrintServiceAttributeEvent psae)
Print Service Attribute Listener.

Specified by:
attributeUpdate in interface PrintServiceAttributeListener
Parameters:
psae - event

pageSetupDialog

public void pageSetupDialog()
Show Dialog and Set Paper Optionally re-calculate layout


setPrinterName

public void setPrinterName(String printerName)
Set Printer (name)

Parameters:
printerName - valid printer name

getPrinterName

public String getPrinterName()
Get Printer (name)

Returns:
printer name

createHTML

public boolean createHTML(File file,
                          boolean onlyTable,
                          Language language)
Create HTML File

Parameters:
file - file
onlyTable - if false create complete HTML document
language - optional language - if null the default language is used to format nubers/dates
Returns:
true if success

createHTML

public boolean createHTML(Writer writer,
                          boolean onlyTable,
                          Language language)
Write HTML to writer

Parameters:
writer - writer
onlyTable - if false create complete HTML document
language - optional language - if null nubers/dates are not formatted
Returns:
true if success

createCSV

public boolean createCSV(File file,
                         char delimiter,
                         Language language)
Create CSV File

Parameters:
file - file
delimiter - delimiter, e.g. comma, tab
language - translation language
Returns:
true if success

createCSV

public boolean createCSV(Writer writer,
                         char delimiter,
                         Language language)
Write CSV to writer

Parameters:
writer - writer
delimiter - delimiter, e.g. comma, tab
language - translation language
Returns:
true if success

createXML

public boolean createXML(File file)
Create XML File

Parameters:
file - file
Returns:
true if success

createXML

public boolean createXML(Writer writer)
Write XML to writer

Parameters:
writer - writer
Returns:
true if success

getPDF

public File getPDF()
Create PDF file. (created in temporary storage)

Returns:
PDF file

getPDF

public File getPDF(File file)
Create PDF file.

Parameters:
file - file
Returns:
PDF file

createPDF

public boolean createPDF(File file)
Create PDF File

Parameters:
file - file
Returns:
true if success

createPDFData

public byte[] createPDFData()
Create PDF as Data array

Returns:
pdf data

createPS

public boolean createPS(File file)
Create PostScript File

Parameters:
file - file
Returns:
true if success

createPS

public boolean createPS(OutputStream os)
Write PostScript to writer

Parameters:
os - output stream
Returns:
true if success

createXLS

public void createXLS(File outFile,
                      Language language)
               throws Exception
Create Excel file

Parameters:
outFile - output file
language -
Throws:
Exception - if error

get

public static ReportEngine get(Properties ctx,
                               ProcessInfo pi)
Get Report Engine for process info

Parameters:
ctx - context
pi - process info with AD_PInstance_ID
Returns:
report engine or null

get

public static ReportEngine get(Properties ctx,
                               int type,
                               int Record_ID)
Get Document Print Engine for Document Type.

Parameters:
ctx - context
type - document type
Record_ID - id
Returns:
Report Engine or null

get

public static ReportEngine get(Properties ctx,
                               int type,
                               int Record_ID,
                               String trxName)
Get Document Print Engine for Document Type.

Parameters:
ctx - context
type - document type
Record_ID - id
trxName -
Returns:
Report Engine or null

printConfirm

public static void printConfirm(int type,
                                int Record_ID)
Print Confirm. Update Date Printed

Parameters:
type - document type
Record_ID - record id

main

public static void main(String[] args)
Test

Parameters:
args - args

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.