Class StiFunctionsData

java.lang.Object
com.stimulsoft.report.dictionary.functions.StiFunctionsData

public class StiFunctionsData extends Object
Copyright Stimulsoft
  • Constructor Details

    • StiFunctionsData

      public StiFunctionsData()
  • Method Details

    • isAllDataRowNullOrEmpty

      public static boolean isAllDataRowNullOrEmpty(Object dataSource, String dataColumn) throws StiException
      Checks if all rows in the specified data column of the given data source or business object are null or empty.
      Parameters:
      dataSource - The data source or business object to check.
      dataColumn - The name of the data column to check.
      Returns:
      True if all rows in the specified data column are null or empty; otherwise, false.
      Throws:
      StiException - Thrown when the data source or business object is null, or when the data column name is null.
    • isDataEmpty

      public static boolean isDataEmpty(Object dataSource) throws StiException
      Checks if the specified data source or business object is empty.
      Parameters:
      dataSource - The data source or business object to check.
      Returns:
      True if the data source or business object is empty; otherwise, false.
      Throws:
      StiException - Thrown when the data source or business object is null.
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Object dataSource, String dataColumn) throws StiException
      Determines whether the specified data column in the given data source or business object is null or empty.
      Parameters:
      dataSource - The data source or business object to check.
      dataColumn - The name of the data column to check.
      Returns:
      True if the specified data column is null or empty; otherwise, false.
      Throws:
      StiException - Thrown when the data source or business object is null, or when the data column name is null.
    • isNullOrEmpty

      public static boolean isNullOrEmpty(Object value)
    • isNullOrWhiteSpace

      public static boolean isNullOrWhiteSpace(Object dataSource, String dataColumn) throws StiException
      Determines whether the specified data column in the given data source or business object is null or consists only of white-space characters.
      Parameters:
      dataSource - The data source or business object to check.
      dataColumn - The name of the data column to check.
      Returns:
      True if the specified data column is null or consists only of white-space characters; otherwise, false.
      Throws:
      StiException - Thrown when the data source or business object is null, or when the data column name is null.
    • isNullOrWhiteSpace

      public static boolean isNullOrWhiteSpace(Object value)
      Determines whether the specified value is null or consists only of white-space characters.
      Parameters:
      value - The value to check.
      Returns:
      True if the value is null or consists only of white-space characters; otherwise, false.
    • isNumeric

      public static boolean isNumeric(Object value)
      Determines whether the specified value is numeric.
      Parameters:
      value - The value to check.
      Returns:
      True if the value is numeric; otherwise, false.
    • vLookup

      public static Object vLookup(Object value, Object dataObject, String dataColumnToLook, String dataColumnToReturn)
      Performs a vertical lookup for a specified value in a data source or business object.
      Parameters:
      value - The value to search for in the specified data column.
      dataObject - The data source or business object to search within.
      dataColumnToLook - The name of the data column to search for the value.
      dataColumnToReturn - The name of the data column from which to return the value.
      Returns:
      The value from the specified data column to return, or null if the value is not found.
    • vLookupStr

      public static Object vLookupStr(Object value, Object dataObject, String dataColumnToLook, String dataColumnToReturn, boolean exactMatch)
      Performs a vertical lookup for a specified value in a data source or business object, with an option for exact match.
      Parameters:
      value - The value to search for in the specified data column.
      dataObject - The data source or business object to search within.
      dataColumnToLook - The name of the data column to search for the value.
      dataColumnToReturn - The name of the data column from which to return the value.
      exactMatch - Indicates whether to perform an exact match search.
      Returns:
      The value from the specified data column to return, or null if the value is not found.
    • vLookup

      public static Object vLookup(Object value, Object dataObject, String dataColumnToLook, String dataColumnToReturn, boolean asString, boolean exactMatch)
      Performs a vertical lookup for a specified value in a data source or business object.
      Parameters:
      value - The value to search for in the specified data column.
      dataObject - The data source or business object to search within.
      dataColumnToLook - The name of the data column to search for the value.
      dataColumnToReturn - The name of the data column from which to return the value.
      asString - Indicates whether to perform the lookup as a string comparison.
      exactMatch - Indicates whether to perform an exact match search.
      Returns:
      The value from the specified data column to return, or null if the value is not found.
    • joinColumnContent

      public static String joinColumnContent(Object dataSource, String dataColumn, String delimiter)
      Joins the content of a specified column from a data source or business object into a single string, separated by a specified delimiter.
      Parameters:
      dataSource - The data source or business object containing the column.
      dataColumn - The name of the column whose content is to be joined.
      delimiter - The delimiter to use for separating the column values in the resulting string.
      distinct - Indicates whether to include only distinct values from the column.
      Returns:
      A string containing the joined column values, separated by the specified delimiter.
    • joinColumnContent

      public static String joinColumnContent(Object dataSource, String dataColumn, String delimiter, boolean distinct)
      Joins the content of a specified column from a data source or business object into a single string, separated by a specified delimiter.
      Parameters:
      dataSource - The data source or business object containing the column.
      dataColumn - The name of the column whose content is to be joined.
      delimiter - The delimiter to use for separating the column values in the resulting string.
      distinct - Indicates whether to include only distinct values from the column.
      Returns:
      A string containing the joined column values, separated by the specified delimiter.
    • toQueryString

      public static String toQueryString(List list, String quotationMark, String dateTimeFormat)
      Converts a list of items to a query string format.
      Parameters:
      list - The type of items in the list.
      quotationMark - The quotation mark to use for string values.
      dateTimeFormat - The format to use for DateTime values.
      needEscape - Indicates whether the values need to be escaped.
      Returns:
      A query string representation of the list.
    • toQueryString

      public static String toQueryString(List list, String quotationMark, String dateTimeFormat, boolean needEscape)
      Converts a list of items to a query string format.
      Parameters:
      list - The type of items in the list.
      quotationMark - The quotation mark to use for string values.
      dateTimeFormat - The format to use for DateTime values.
      needEscape - Indicates whether the values need to be escaped.
      Returns:
      A query string representation of the list.
    • coalesce

      public static Object coalesce(Object[] args)
      Returns the first non-null and non-DBNull value from the provided arguments.
      Parameters:
      args - An array of objects to check.
      Returns:
      The first non-null and non-DBNull value, or null if all arguments are null or DBNull.
    • coalesceStr

      public static String coalesceStr(Object[] args)
      Returns the first non-null and non-empty string from the provided arguments.
      Parameters:
      args - An array of objects to check.
      Returns:
      The first non-null and non-empty string, or null if all arguments are null or empty.
    • getRealPageNumber

      public static int getRealPageNumber(Object sender)
    • getCrossTabColumnValue

      public static String getCrossTabColumnValue(Object sender)
      Retrieves the cross-tab column value from the provided sender object.
      Parameters:
      sender - The sender object, expected to be of type @StiCrossSummary
      Returns:
      The cross-tab column value as a string, or null if the sender is not of the expected type.
    • getCrossTabRowValue

      public static String getCrossTabRowValue(Object sender)
      Retrieves the cross-tab row value from the provided sender object.
      Parameters:
      sender - The sender object, expected to be of type @StiCrossSummary
      Returns:
      The cross-tab row value as a string, or null if the sender is not of the expected type.