Compiere 3.1

org.compiere.print
Class MPrintFormat

java.lang.Object
  extended by org.compiere.framework.PO
      extended by org.compiere.model.X_AD_PrintFormat
          extended by org.compiere.print.MPrintFormat
All Implemented Interfaces:
Serializable, Cloneable, Comparator<PO>, Evaluatee

public class MPrintFormat
extends X_AD_PrintFormat

AD_PrintFormat - Print Format Model. (Add missing Items with PrintFormatUtil)

Version:
$Id: MPrintFormat.java,v 1.3 2006/07/30 00:53:02 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_AD_PrintFormat
accessLevel, Model, Table_ID, Table_Name, updatedMS
 
Fields inherited from class org.compiere.framework.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_changeVO, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Constructor Summary
MPrintFormat(Ctx ctx, int AD_PrintFormat_ID, String trxName)
          Public Constructor.
MPrintFormat(Ctx ctx, ResultSet rs, String trxName)
          Load Constructor
 
Method Summary
static MPrintFormat copy(Ctx ctx, int from_AD_PrintFormat_ID, int to_AD_PrintFormat_ID)
          Copy existing Definition To Client
static MPrintFormat copyToClient(Ctx ctx, int AD_PrintFormat_ID, int to_Client_ID)
          Copy existing Definition To Client
static MPrintFormat createFromReportView(Ctx ctx, int AD_ReportView_ID, String ReportName)
          Create MPrintFormat for ReportView
static MPrintFormat createFromTable(Ctx ctx, int AD_Table_ID)
          Create MPrintFormat for Table
static MPrintFormat createFromTable(Ctx ctx, int AD_Table_ID, int AD_PrintFormat_ID)
          Create MPrintFormat for Table
static MPrintFormat get(Ctx ctx, int AD_PrintFormat_ID, boolean reload)
          Get Format
static MPrintFormat get(Ctx ctx, int AD_ReportView_ID, int AD_Table_ID)
          Get (default) Printformat for Report View or Table
 int[] getAD_Column_IDs()
          Get AD_Column_IDs of columns in Report
 MPrintFormatItem getItem(int index)
          Get Print Format Item
 int getItemCount()
          Get Item Count
 Language getLanguage()
          Get Language
 int[] getOrderAD_Column_IDs()
          Get AD_Column_ID of Order Columns
 MPrintTableFormat getTableFormat()
          Get Table Format
 boolean isTranslationView()
          Get Translation View use
protected  Object loadSpecial(ResultSet rs, int index)
          Load Special data (images, ..).
static void main(String[] args)
          Test
protected  String saveNewSpecial(Object value, int index)
          Save Special Data.
 void setAD_PrintTableFormat_ID(int AD_PrintTableFormat_ID)
          Get Optional TableFormat
 void setIsTableBased(boolean tableBased)
          Set Table based.
protected  void setItems(MPrintFormatItem[] items)
          Set Items
 void setLanguage(Language language)
          Set Language
 void setStandardHeaderFooter(boolean standardHeaderFooter)
          Set Standard Header
 void setTranslation()
          Set the translation of the Format Items to the original
 void setTranslationLanguage(Language language)
          Set Translation View Language.
 void setTranslationViewQuery(Query query)
          Update the Query to access the Translation View.
 String toString()
          Sting Representation
 
Methods inherited from class org.compiere.model.X_AD_PrintFormat
get_AccessLevel, getAD_BView_ID, getAD_PrintColor_ID, getAD_PrintFont_ID, getAD_PrintFormat_ID, getAD_PrintPaper_ID, getAD_PrintTableFormat_ID, getAD_ReportView_ID, getAD_Table_ID, getCreateCopy, getDescription, getFooterMargin, getHeaderMargin, getKeyNamePair, getName, getPrinterName, initPO, isDefault, isForm, isStandardHeaderFooter, isTableBased, isTotalsOnly, setAD_BView_ID, setAD_PrintColor_ID, setAD_PrintFont_ID, setAD_PrintFormat_ID, setAD_PrintPaper_ID, setAD_ReportView_ID, setAD_Table_ID, setCreateCopy, setDescription, setFooterMargin, setHeaderMargin, setIsDefault, setIsForm, setIsStandardHeaderFooter, setIsTotalsOnly, setName, setPrinterName
 
Methods inherited from class org.compiere.framework.PO
addAttachment, addAttachment, addError, afterDelete, afterSave, beforeDelete, beforeSave, compare, convertToBigDecimal, convertToBoolean, convertToInt, convertToTimestamp, copy, copyValues, copyValues, createAttachment, delete_Accounting, delete, delete, dump, dump, equals, get_ChangeVO, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_EntityType, get_HashMap, get_ID, get_IDOld, get_Info, get_KeyColumns, get_Logger, get_Table_ID, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_ValuesAsString, get_WhereClause, get_xmlDocument, get_xmlString, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, getVO, hashCode, insert_Accounting, is_Changed, is_KeyColumn, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, load, load, load, load, loadComplete, loadDefaults, lock, save, save, saveNew_getID, saveNewInsertSQL, saveUpdate, set_ChangeVO, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueString, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setContext, setCtx, setDocWorkflowMgr, setIsActive, setStandardDefaults, setUpdateable, setUpdatedBy, toStringX, unlock, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MPrintFormat

public MPrintFormat(Ctx ctx,
                    int AD_PrintFormat_ID,
                    String trxName)
Public Constructor. Use static get methods

Parameters:
ctx - context
AD_PrintFormat_ID - AD_PrintFormat_ID
trxName - transaction

MPrintFormat

public MPrintFormat(Ctx ctx,
                    ResultSet rs,
                    String trxName)
Load Constructor

Parameters:
ctx - context
rs - result set
trxName - transaction
Method Detail

getLanguage

public Language getLanguage()
Get Language

Returns:
language

setLanguage

public void setLanguage(Language language)
Set Language

Parameters:
language - language

getOrderAD_Column_IDs

public int[] getOrderAD_Column_IDs()
Get AD_Column_ID of Order Columns

Returns:
Array of AD_Column_IDs in Sort Order

getAD_Column_IDs

public int[] getAD_Column_IDs()
Get AD_Column_IDs of columns in Report

Returns:
Array of AD_Column_ID

setItems

protected void setItems(MPrintFormatItem[] items)
Set Items

Parameters:
items - items

getItemCount

public int getItemCount()
Get Item Count

Returns:
number of items or -1 if items not defined

getItem

public MPrintFormatItem getItem(int index)
Get Print Format Item

Parameters:
index - index
Returns:
Print Format Item

setTranslation

public void setTranslation()
Set the translation of the Format Items to the original


setStandardHeaderFooter

public void setStandardHeaderFooter(boolean standardHeaderFooter)
Set Standard Header

Parameters:
standardHeaderFooter - true if std header

setIsTableBased

public void setIsTableBased(boolean tableBased)
Set Table based. Reset Form

Overrides:
setIsTableBased in class X_AD_PrintFormat
Parameters:
tableBased - true if table based

setTranslationLanguage

public void setTranslationLanguage(Language language)
Set Translation View Language.

Parameters:
language - language (checked for base language)

isTranslationView

public boolean isTranslationView()
Get Translation View use

Returns:
true if a translation view is used

setTranslationViewQuery

public void setTranslationViewQuery(Query query)
Update the Query to access the Translation View. Can be called multiple times, adds only if not set already

Parameters:
query - query to be updated

setAD_PrintTableFormat_ID

public void setAD_PrintTableFormat_ID(int AD_PrintTableFormat_ID)
Get Optional TableFormat

Overrides:
setAD_PrintTableFormat_ID in class X_AD_PrintFormat
Parameters:
AD_PrintTableFormat_ID - table format

getTableFormat

public MPrintTableFormat getTableFormat()
Get Table Format

Returns:
Table Format

toString

public String toString()
Sting Representation

Overrides:
toString in class X_AD_PrintFormat
Returns:
info

loadSpecial

protected Object loadSpecial(ResultSet rs,
                             int index)
                      throws SQLException
Load Special data (images, ..). To be extended by sub-classes

Overrides:
loadSpecial in class PO
Parameters:
rs - result set
index - zero based index
Returns:
value value
Throws:
SQLException

saveNewSpecial

protected String saveNewSpecial(Object value,
                                int index)
Save Special Data. To be extended by sub-classes

Overrides:
saveNewSpecial in class PO
Parameters:
value - value
index - index
Returns:
SQL code for INSERT VALUES clause

createFromTable

public static MPrintFormat createFromTable(Ctx ctx,
                                           int AD_Table_ID)
Create MPrintFormat for Table

Parameters:
ctx - context
AD_Table_ID - table
Returns:
print format

createFromTable

public static MPrintFormat createFromTable(Ctx ctx,
                                           int AD_Table_ID,
                                           int AD_PrintFormat_ID)
Create MPrintFormat for Table

Parameters:
ctx - context
AD_Table_ID - table
AD_PrintFormat_ID - 0 or existing PrintFormat
Returns:
print format

createFromReportView

public static MPrintFormat createFromReportView(Ctx ctx,
                                                int AD_ReportView_ID,
                                                String ReportName)
Create MPrintFormat for ReportView

Parameters:
ctx - context
AD_ReportView_ID - ReportView
ReportName - - optional Report Name
Returns:
print format

copy

public static MPrintFormat copy(Ctx ctx,
                                int from_AD_PrintFormat_ID,
                                int to_AD_PrintFormat_ID)
Copy existing Definition To Client

Parameters:
ctx - context
from_AD_PrintFormat_ID - format
to_AD_PrintFormat_ID - format
Returns:
print format

copyToClient

public static MPrintFormat copyToClient(Ctx ctx,
                                        int AD_PrintFormat_ID,
                                        int to_Client_ID)
Copy existing Definition To Client

Parameters:
ctx - context
AD_PrintFormat_ID - format
to_Client_ID - to client
Returns:
print format

get

public static MPrintFormat get(Ctx ctx,
                               int AD_PrintFormat_ID,
                               boolean reload)
Get Format

Parameters:
ctx - context
AD_PrintFormat_ID - id
reload - refresh from disk
Returns:
Format

get

public static MPrintFormat get(Ctx ctx,
                               int AD_ReportView_ID,
                               int AD_Table_ID)
Get (default) Printformat for Report View or Table

Parameters:
ctx - context
AD_ReportView_ID - id or 0
AD_Table_ID - id or 0
Returns:
first print format found or null

main

public static void main(String[] args)
Test

Parameters:
args - arga

Compiere 3.1

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