Class PrintBeanHelper


  • public class PrintBeanHelper
    extends java.lang.Object
    The PrintBeanHelper is a helper for printing, exporting and PDF
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Detail

      • PrintBeanHelper

        public PrintBeanHelper()
    • Method Detail

      • isReportPageByEmpty

        public static boolean isReportPageByEmpty​(ReportBean rb)
        Checks if the report has elements on the page-by axis
        Parameters:
        rb - Report Bean
        Returns:
        true is the report has no elements on the page-by axis
      • renderFilterDetails

        public static void renderFilterDetails​(MarkupOutput mo,
                                               ReportBean rb,
                                               Messages messages)
        Renders the filter details
        Parameters:
        mo - MarkupOutput object
        rb - Report bean
        messages - Messages object
      • renderFilterDetails

        public static void renderFilterDetails​(MarkupOutput mo,
                                               ReportBean rb,
                                               Messages messages,
                                               boolean isPlainText)
        Deprecated.
        Renders the filter details
        Parameters:
        mo - MarkupOutput object
        rb - Report bean
        messages - Messages object
        isPlainText - determines whether to generate the results in plain text (used for Excel with plaintext)
      • renderFilterDetails

        public static void renderFilterDetails​(MarkupOutput mo,
                                               ReportBean rb,
                                               Messages messages,
                                               boolean isPlainText,
                                               boolean isOldStyle)
        Renders the filter details
        Parameters:
        mo - MarkupOutput object
        rb - Report bean
        messages - Messages object
        isPlainText - determines whether to generate the results in plain text (used for Excel with plaintext)
        isOldStyle - determines whether to generate the results with indentation (used for Old Style Filter Details)
        Since:
        MicroStrategy Web 7.5.1
      • renderFilterDetails

        public static void renderFilterDetails​(MarkupOutput mo,
                                               ReportBean rb,
                                               Messages messages,
                                               boolean isPlainText,
                                               java.lang.String newLine,
                                               java.lang.String rowPrefix,
                                               java.lang.String rowSuffix,
                                               boolean isOldStyle)
        Renders the filter details
        Parameters:
        mo - MarkupOutput object
        rb - Report bean
        messages - Messages object
        isPlainText - determines whether to generate the results in plain text (used for Excel with plaintext)
        newLine - The line Separator to use.
        rowPrefix - The prefix for each row
        rowSuffix - The suffix for each row
        isOldStyle - Denotes whether the Filter Details have to be rendered using old style.
        Since:
        MicroStrategy Web 8.0.0
      • renderPagebyInfo

        public static void renderPagebyInfo​(MarkupOutput mo,
                                            ReportBean rb,
                                            java.lang.String stylePagebyInfo,
                                            Messages messages)
        Renders the page-by information by transforming the report bean with the stylePageby parameter.
        Parameters:
        mo - MarkupOutput object
        rb - report bean
        stylePagebyInfo - style to use
        messages - Messages object
      • getDescriptor

        public static java.lang.String getDescriptor​(int key,
                                                     Messages messages)
        Returns a localized descriptor for the specified key
        Parameters:
        key - int
        messages - Messages
        Returns:
        String
      • setResultWindow

        public static void setResultWindow​(ReportBean rb,
                                           int startRow,
                                           int startCol,
                                           int maxRows,
                                           int maxCols)
        Sets the result window of the report instance to the proper values depending on the input parameters
        Parameters:
        rb - report bean
        startRow - window's start row
        startCol - window's start column
        maxRows - window's maximum row
        maxCols - window's maximum column
      • getTotalReportCells

        public static int getTotalReportCells​(ReportBean rb)
                                       throws WebAppException
        Calculates the total number of cells on the report.
        Parameters:
        rb - report
        Returns:
        number of cells
        Throws:
        WebAppException
      • getCurrentReportCells

        public static int getCurrentReportCells​(ReportBean rb)
                                         throws WebAppException
        Calculates the current number of cells on the report.
        Parameters:
        rb - report
        Returns:
        number of cells
        Throws:
        WebAppException
      • getReportTotalRows

        public static int getReportTotalRows​(ReportBean rb)
        Returns the report's total number of rows depending on the view mode
        Parameters:
        rb - ReportBean to print
        Returns:
        total number of rows
      • getReportTotalCols

        public static int getReportTotalCols​(ReportBean rb)
        Returns the report's total number of columns depending on the view mode
        Parameters:
        rb - ReportBean to print
        Returns:
        total number of columns
      • getTime

        public static java.lang.String getTime()
        Returns a String representation of the time. Used for the header/footer in print and PDF.
        Returns:
        a String representation of the time.
      • getTime

        public static java.lang.String getTime​(java.lang.String localeID)
        Returns a String representation of the time. Used for the header/footer in print and PDF.
        Parameters:
        localeID - locale to display the date in.
        Returns:
        a String representation of the time.
        Since:
        MicroStrategy Web 7.5.0
      • getDate

        public static java.lang.String getDate()
        Returns a String representation of the date. Used for the header/footer in print and PDF.
        Returns:
        a String representation of the date.
      • getDate

        public static java.lang.String getDate​(java.lang.String localeID)
        Returns a String representation of the date. Used for the header/footer in print and PDF.
        Parameters:
        localeID - locale to display the date in.
        Returns:
        a String representation of the date.
        Since:
        MicroStrategy Web 7.5.0
      • getOptionValue

        public static java.lang.String getOptionValue​(RequestKeys rk,
                                                      Preferences pref,
                                                      HashList propertyValues,
                                                      boolean propertiesPresent,
                                                      java.lang.String preferenceName,
                                                      java.lang.String propertyName)
      • getCheckboxOptionValue

        public static boolean getCheckboxOptionValue​(RequestKeys rk,
                                                     Preferences pref,
                                                     HashList propertyValues,
                                                     boolean propertiesPresent,
                                                     java.lang.String preferenceName,
                                                     java.lang.String propertyName)
      • getErrorInGraphReport

        public static java.lang.String getErrorInGraphReport​(ReportBean rb,
                                                             Messages messages)
        Returns whether the graph report is in error
        Parameters:
        rb - Report bean
        messages - Messages object
        Returns:
        error in graph (if any)
        Since:
        MicroStrategy Web 7.5.0
      • getErrorInGraphReport

        public static java.lang.String getErrorInGraphReport​(ReportBean rb,
                                                             Messages messages,
                                                             WebIServerSession session)
        Returns whether the graph report is in error
        Parameters:
        rb - Report bean
        messages - Messages object
        Returns:
        error in graph (if any)
        Since:
        MicroStrategy Web 9.0.1