Class MPrintFormat

    • Constructor Detail

      • MPrintFormat

        public MPrintFormat​(Properties 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​(Properties ctx,
                            ResultSet rs,
                            String trxName)
        Load Constructor
        Parameters:
        ctx - context
        rs - result set
        trxName - transaction
      • MPrintFormat

        public MPrintFormat​(MPrintFormat copy)
        Parameters:
        copy -
    • Method Detail

      • reloadItems

        public void reloadItems()
      • 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
      • getAllItems

        public MPrintFormatItem[] getAllItems()
        Get All Items
        Returns:
        items
      • getAllItems

        public MPrintFormatItem[] getAllItems​(String orderBy)
        Get All Items
        Parameters:
        orderBy -
        Returns:
        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
      • 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​(MQuery 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
      • getTableFormat

        public MPrintTableFormat getTableFormat()
        Get Table Format
        Returns:
        Table Format
      • 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​(Properties ctx,
                                                   int AD_Table_ID)
        Create MPrintFormat for Table
        Parameters:
        ctx - context
        AD_Table_ID - table
        Returns:
        print format
      • createFromTable

        public static MPrintFormat createFromTable​(Properties 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
      • createFromTable

        public static MPrintFormat createFromTable​(Properties ctx,
                                                   int AD_Table_ID,
                                                   int AD_PrintFormat_ID,
                                                   String trxName)
        Create MPrintFormat for Table
        Parameters:
        ctx - context
        AD_Table_ID - table
        AD_PrintFormat_ID - 0 or existing PrintFormat
        trxName - the transaction
        Returns:
        print format
      • createFromReportView

        public static MPrintFormat createFromReportView​(Properties 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
      • setUniqueName

        public static void setUniqueName​(int AD_Client_ID,
                                         MPrintFormat pf,
                                         String basename)
      • copy

        public static MPrintFormat copy​(Properties 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​(Properties 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
      • copyToClient

        public static MPrintFormat copyToClient​(Properties ctx,
                                                int AD_PrintFormat_ID,
                                                int to_Client_ID,
                                                String trxName)
        Copy existing Definition To Client
        Parameters:
        ctx - context
        AD_PrintFormat_ID - format
        to_Client_ID - to client
        trxName -
        Returns:
        print format
      • get

        public static MPrintFormat get​(int AD_PrintFormat_ID)
        Get Format from cache (immutable)
        Parameters:
        AD_PrintFormat_ID - id
        Returns:
        Format
      • get

        public static MPrintFormat get​(Properties ctx,
                                       int AD_PrintFormat_ID,
                                       boolean readFromDisk)
        Get Format from cache (immutable)
        Parameters:
        ctx - context
        AD_PrintFormat_ID - id
        readFromDisk - refresh from disk
        Returns:
        Format
      • get

        public static MPrintFormat get​(Properties 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
      • deleteFromCache

        public static void deleteFromCache​(int AD_PrintFormat_ID)
        Delete Format from Cache
        Parameters:
        AD_PrintFormat_ID - id
      • getPrintFormat_ID

        public static int getPrintFormat_ID​(String formatName,
                                            int AD_Table_ID,
                                            int AD_Client_ID)
        Get ID of Print Format use Name
        Parameters:
        formatName -
        AD_Table_ID -
        AD_Client_ID -
        Returns:
        AD_PrintFormat_ID
      • getAccessiblePrintFormats

        public static List<KeyNamePair> getAccessiblePrintFormats​(int AD_Table_ID,
                                                                  int AD_Window_ID,
                                                                  String trxName,
                                                                  boolean makeNewWhenEmpty)
        Parameters:
        AD_Table_ID -
        AD_Window_ID -
        trxName -
        makeNewWhenEmpty -
        Returns:
      • getZoomWindowID

        public static int getZoomWindowID​(int AD_PrintFormat_ID)