Updated color code in pdf

This commit is contained in:
nisha
2025-01-15 21:09:54 +05:30
parent 1b6a11a771
commit 70a3098fae

View File

@@ -264,8 +264,10 @@ 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()
contentResponseBean.getSettings().stream()
.filter(setting -> "table_columns".equals(setting.getName())) // Check for "table_columns"
.map(SettingResponseBean::getValue)
.filter(Objects::nonNull) // Ensure value is not null
@@ -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 {