Updated color code in pdf
This commit is contained in:
@@ -264,6 +264,8 @@ public class PdfDao {
|
||||
Map<String, Boolean> formulaEnabledMap = new HashMap<>();
|
||||
Map<String, String> formulaTypeMap = new HashMap<>();
|
||||
Map<String, String> fieldTypeMap = new HashMap<>();
|
||||
Font lightGrayFont = FontFactory.getFont(FontFactory.HELVETICA, 12, Font.NORMAL, new BaseColor(110, 110, 110)); // Light gray
|
||||
|
||||
|
||||
contentResponseBean.getSettings().stream()
|
||||
.filter(setting -> "table_columns".equals(setting.getName())) // Check for "table_columns"
|
||||
@@ -375,9 +377,17 @@ public class PdfDao {
|
||||
|
||||
if (columnSums.containsKey(key)) {
|
||||
double total = columnSums.getOrDefault(key, 0.0); // Get the total for the column
|
||||
PdfPCell sumCell = PdfUtils.htmlToPdfPCell(Utils.convertToItalianFormat(String.valueOf(total)), textFont);
|
||||
// PdfPCell sumCell = PdfUtils.htmlToPdfPCell(Utils.convertToItalianFormat(String.valueOf(total)), textFont);
|
||||
// Convert total to Italian format, defaulting to "0" if null
|
||||
String formattedTotal = Utils.convertToItalianFormat(String.valueOf(total));
|
||||
|
||||
// Create a table cell with the formatted value
|
||||
PdfPCell sumCell = new PdfPCell(new Phrase(formattedTotal,lightGrayFont));
|
||||
|
||||
|
||||
sumCell.setBackgroundColor(new BaseColor(239, 243, 248)); // Light blue for totals
|
||||
sumCell.setHorizontalAlignment(Element.ALIGN_CENTER);
|
||||
sumCell.setPaddingTop(8f);
|
||||
sumCell.setMinimumHeight(30f);
|
||||
table.addCell(sumCell); // Add total for the column
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user