Compiere 3.1

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

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

Nested Class Summary
 class ReportEngine.MyPageable
           
 class ReportEngine.MyPrintable
           
 
Field Summary
static int CHECK
          Check = 6
static int DUNNING
          Dunning = 7
static int INVENTORY
          Inventory = 9
static int INVOICE
          Invoice = 2
static int MOVEMENT
          Movement = 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
static int WORKORDER
          WorkOrder = 10
 
Constructor Summary
ReportEngine(Ctx ctx, MPrintFormat pf, Query query, PrintInfo info)
          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
 Excel createEXCEL(Excel excel, Language language)
           
 boolean createEXCEL(File file, Language language)
           
 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(FileOutputStream fos)
          Write PostScript to writer
 boolean createXML(File file)
          Create XML File
 boolean createXML(Writer writer)
          Write XML to writer
static ReportEngine get(Ctx ctx, int type, int Record_ID)
          Get Document Print Engine for Document Type.
static ReportEngine get(Ctx ctx, ProcessInfo pi)
          Get Report Engine for process info
static org.compiere.print.BusinessView getBusinessView(ProcessInfo pi)
           
 int getColumnCount()
          Get Column Count
 Ctx 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
 Query 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(Query 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

MOVEMENT

public static final int MOVEMENT
Movement = 8

See Also:
Constant Field Values

INVENTORY

public static final int INVENTORY
Inventory = 9

See Also:
Constant Field Values

WORKORDER

public static final int WORKORDER
WorkOrder = 10

See Also:
Constant Field Values
Constructor Detail

ReportEngine

public ReportEngine(Ctx ctx,
                    MPrintFormat pf,
                    Query query,
                    PrintInfo info)
Constructor

Parameters:
ctx - context
pf - Print Format
query - Optional Query
info - print info
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(Query query)
Set Query and generate PrintData. If Layout was created, re-create layout

Parameters:
query - query

getQuery

public Query 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 Ctx 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(FileOutputStream fos)
Write PostScript to writer

Parameters:
fos - file output stream
Returns:
true if success

get

public static ReportEngine get(Ctx 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(Ctx 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

printConfirm

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

Parameters:
type - document type
Record_ID - record id

createEXCEL

public Excel createEXCEL(Excel excel,
                         Language language)

createEXCEL

public boolean createEXCEL(File file,
                           Language language)

getBusinessView

public static org.compiere.print.BusinessView getBusinessView(ProcessInfo pi)

main

public static void main(String[] args)
Test

Parameters:
args - args

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.