Package com.basiscomponents.db.export
Class ColumnWidthCalculator
- java.lang.Object
-
- com.basiscomponents.db.export.ColumnWidthCalculator
-
public class ColumnWidthCalculator extends Object
Calculates the column width
-
-
Field Summary
Fields Modifier and Type Field Description static String
BASIS_BASE_FONT_BOLD_RESOURCE_PATH
static String
BASIS_BASE_FONT_RESOURCE_PATH
static int
BASIS_BASE_FONT_SIZE
-
Constructor Summary
Constructors Constructor Description ColumnWidthCalculator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataRow
calculateColumnWidths(ResultSet rs, float fontSize)
Calculates the column widthsstatic DataRow
calculateColumnWidths(ResultSet rs, float fontSize, boolean useLabel)
Calculates the column widthsstatic DataRow
calculateColumnWidths(ResultSet rs, float fontSize, boolean calculateAllRows, boolean useLabel)
Calculates the column widthsstatic DataRow
calculateColumnWidths(ResultSet rs, String fontResourcePath, float fontSize, int rowsToCheck, boolean calculateAllRows, boolean useLabel)
Calculates the column widths
-
-
-
Field Detail
-
BASIS_BASE_FONT_RESOURCE_PATH
public static final String BASIS_BASE_FONT_RESOURCE_PATH
- See Also:
- Constant Field Values
-
BASIS_BASE_FONT_BOLD_RESOURCE_PATH
public static final String BASIS_BASE_FONT_BOLD_RESOURCE_PATH
- See Also:
- Constant Field Values
-
BASIS_BASE_FONT_SIZE
public static final int BASIS_BASE_FONT_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
calculateColumnWidths
public static DataRow calculateColumnWidths(ResultSet rs, float fontSize, boolean calculateAllRows, boolean useLabel)
Calculates the column widths- Parameters:
rs
- the result set which contains representative data rowsfontSize
- the font size that is used to calculate the column widthcalculateAllRows
- indicator if the perfect column width should be calculated for all rows in the result setuseLabel
- indicates if the label instead of the field name should be used- Returns:
- returns a data row which contains the width for each column (data field)
-
calculateColumnWidths
public static DataRow calculateColumnWidths(ResultSet rs, float fontSize)
Calculates the column widths- Parameters:
rs
- the result set which contains representative data rowsfontSize
- the font size that is used to calculate the column width- Returns:
- returns a data row which contains the width for each column (data field)
-
calculateColumnWidths
public static DataRow calculateColumnWidths(ResultSet rs, float fontSize, boolean useLabel)
Calculates the column widths- Parameters:
rs
- the result set which contains representative data rowsfontSize
- the font size that is used to calculate the column widthuseLabel
- indicates if the label instead of the field name should be used- Returns:
- returns a data row which contains the width for each column (data field)
-
calculateColumnWidths
public static DataRow calculateColumnWidths(ResultSet rs, String fontResourcePath, float fontSize, int rowsToCheck, boolean calculateAllRows, boolean useLabel)
Calculates the column widths- Parameters:
rs
- the result set which contains representative data rowsfontResourcePath
- path leading to the font resourcefontSize
- the font size that is used to calculate the column widthrowsToCheck
- the number of rows that should be used to calculate the column widthcalculateAllRows
- indicator if the perfect column width should be calculated for all rows in the result setuseLabel
- indicates if the label instead of the field name should be used- Returns:
- returns a data row which contains the width for each column (data field)
-
-