Example usage for com.lowagie.text.pdf PdfPTable getDefaultCell

List of usage examples for com.lowagie.text.pdf PdfPTable getDefaultCell

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPTable getDefaultCell.

Prototype

public PdfPCell getDefaultCell() 

Source Link

Document

Gets the default PdfPCell that will be used as reference for all the addCell methods except addCell(PdfPCell).

Usage

From source file:com.qcadoo.mes.deliveries.print.OrderReportPdf.java

License:Open Source License

private void addTotalRow(final PdfPTable productsTable, final Locale locale, final List<String> columnsName,
        Entity delivery) {/*from  ww w.j a  va2  s  .c om*/
    DeliveryPricesAndQuantities deliveryPricesAndQuantities = new DeliveryPricesAndQuantities(delivery,
            numberService);

    PdfPCell total = new PdfPCell(
            new Phrase(translationService.translate("deliveries.delivery.report.totalCost", locale),
                    FontUtils.getDejavuRegular7Dark()));

    total.setColspan(2);
    total.setHorizontalAlignment(Element.ALIGN_LEFT);
    total.setVerticalAlignment(Element.ALIGN_MIDDLE);
    total.setBackgroundColor(null);
    total.disableBorderSide(Rectangle.RIGHT);
    total.disableBorderSide(Rectangle.LEFT);
    total.setBorderColor(ColorUtils.getLineLightColor());

    productsTable.addCell(total);

    for (int i = 2; i < columnsName.size(); i++) {
        if (columnsName.contains(OrderedProductFields.ORDERED_QUANTITY)
                && columnsName.indexOf(OrderedProductFields.ORDERED_QUANTITY) == i) {
            productsTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            productsTable.addCell(
                    new Phrase(numberService.format(deliveryPricesAndQuantities.getOrderedCumulatedQuantity()),
                            FontUtils.getDejavuRegular7Dark()));
        } else if (columnsName.contains(OrderedProductFields.TOTAL_PRICE)
                && columnsName.indexOf(OrderedProductFields.TOTAL_PRICE) == i) {
            productsTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            productsTable.addCell(
                    new Phrase(numberService.format(deliveryPricesAndQuantities.getOrderedTotalPrice()),
                            FontUtils.getDejavuRegular7Dark()));
        } else if (columnsName.contains(L_CURRENCY) && columnsName.indexOf(L_CURRENCY) == i) {
            productsTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
            productsTable.addCell(
                    new Phrase(deliveriesService.getCurrency(delivery), FontUtils.getDejavuRegular7Dark()));
        } else {
            productsTable.addCell("");
        }
    }
}

From source file:com.qcadoo.mes.deviationCausesReporting.print.DeviationsProtocolPdf.java

License:Open Source License

private PdfPTable createHeaderTable(final Interval searchDatesRange, final Locale locale) {
    PdfPTable headerTable = pdfHelper.createPanelTable(2);
    headerTable.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
    pdfHelper.addTableCellAsTwoColumnsTable(headerTable,
            translate("deviationCausesReporting.report.header.dateFrom.label", locale),
            DateUtils.toDateString(searchDatesRange.getStart().toDate()));
    pdfHelper.addTableCellAsTwoColumnsTable(headerTable,
            translate("deviationCausesReporting.report.header.dateTo.label", locale),
            DateUtils.toDateString(searchDatesRange.getEnd().toDate()));
    return headerTable;
}

From source file:com.qcadoo.mes.materialFlow.print.pdf.MaterialFlowPdfService.java

License:Open Source License

@Override
protected void buildPdfContent(final Document document, final Entity materialsInLocation, final Locale locale)
        throws DocumentException {
    Map<Entity, BigDecimal> reportData = materialFlowService
            .calculateMaterialQuantitiesInLocation(materialsInLocation);

    String documenTitle = translationService.translate("materialFlow.materialFlow.report.title", locale);
    String documentAuthor = translationService.translate("qcadooReport.commons.generatedBy.label", locale);
    pdfHelper.addDocumentHeader(document, "", documenTitle, documentAuthor,
            (Date) materialsInLocation.getField(TIME), materialsInLocation.getStringField(WORKER));

    PdfPTable panelTable = pdfHelper.createPanelTable(2);
    pdfHelper.addTableCellAsOneColumnTable(panelTable,
            translationService.translate("materialFlow.materialFlow.report.panel.materialFlowForDate", locale),
            ((Date) materialsInLocation.getField(MATERIAL_FLOW_FOR_DATE)).toString());
    pdfHelper.addTableCellAsOneColumnTable(panelTable,
            translationService.translate("materialFlow.materialFlow.report.panel.time", locale),
            ((Date) materialsInLocation.getField(TIME)).toString());

    List<Entity> materialsInLocationComponents = materialsInLocation
            .getHasManyField(MATERIALS_IN_LOCATION_COMPONENTS);
    List<String> names = new ArrayList<String>();
    for (Entity materialsInLocationComponent : materialsInLocationComponents) {
        Entity location = (Entity) materialsInLocationComponent.getField(LOCATION);
        names.add(location.getField(NUMBER).toString());
    }/*from   ww w  .j a  va 2 s .c  o  m*/
    pdfHelper.addTableCellAsOneColumnTable(panelTable,
            translationService.translate("materialFlow.materialFlow.report.panel.locations", locale), names);
    pdfHelper.addTableCellAsOneColumnTable(panelTable, "", "");

    panelTable.setSpacingBefore(20);
    panelTable.setSpacingAfter(20);
    document.add(panelTable);

    List<String> tableHeader = new ArrayList<String>();
    Map<String, HeaderAlignment> alignments = Maps.newHashMap();

    tableHeader
            .add(translationService.translate("materialFlow.materialFlow.report.columnHeader.number", locale));
    tableHeader.add(translationService.translate("materialFlow.materialFlow.report.columnHeader.name", locale));
    tableHeader.add(
            translationService.translate("materialFlow.materialFlow.report.columnHeader.quantity", locale));
    tableHeader.add(translationService.translate("materialFlow.materialFlow.report.columnHeader.unit", locale));

    alignments.put(translationService.translate("materialFlow.materialFlow.report.columnHeader.number", locale),
            HeaderAlignment.LEFT);
    alignments.put(translationService.translate("materialFlow.materialFlow.report.columnHeader.name", locale),
            HeaderAlignment.LEFT);
    alignments.put(
            translationService.translate("materialFlow.materialFlow.report.columnHeader.quantity", locale),
            HeaderAlignment.RIGHT);
    alignments.put(translationService.translate("materialFlow.materialFlow.report.columnHeader.unit", locale),
            HeaderAlignment.LEFT);

    PdfPTable table = pdfHelper.createTableWithHeader(4, tableHeader, false, alignments);

    for (Map.Entry<Entity, BigDecimal> data : reportData.entrySet()) {
        table.addCell(new Phrase(data.getKey().getStringField(NUMBER), FontUtils.getDejavuRegular7Dark()));
        table.addCell(new Phrase(data.getKey().getStringField(NAME), FontUtils.getDejavuRegular7Dark()));
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        table.addCell(new Phrase(numberService.format(data.getValue()), FontUtils.getDejavuRegular7Dark()));
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        table.addCell(new Phrase(data.getKey().getStringField(UNIT), FontUtils.getDejavuRegular7Dark()));
    }
    document.add(table);
}

From source file:com.qcadoo.mes.materialRequirements.print.pdf.MaterialRequirementPdfService.java

License:Open Source License

private void addTechnologySeries(final Document document, final Entity materialRequirement,
        final Map<String, HeaderAlignment> headersWithAlignments) throws DocumentException {
    List<Entity> orders = materialRequirement.getManyToManyField(MaterialRequirementFields.ORDERS);
    MrpAlgorithm algorithm = MrpAlgorithm
            .parseString(materialRequirement.getStringField(MaterialRequirementFields.MRP_ALGORITHM));

    Map<Long, BigDecimal> neededProductQuantities = productQuantitiesService.getNeededProductQuantities(orders,
            algorithm, true);/*from w w  w . j  a  v a 2s. co m*/

    // TODO LUPO fix comparator
    // neededProductQuantities = SortUtil.sortMapUsingComparator(neededProductQuantities, new EntityNumberComparator());

    List<String> headers = Lists.newLinkedList(headersWithAlignments.keySet());
    PdfPTable table = pdfHelper.createTableWithHeader(headersWithAlignments.size(), headers, true,
            defaultOrderHeaderColumnWidth, headersWithAlignments);

    for (Entry<Long, BigDecimal> neededProductQuantity : neededProductQuantities.entrySet()) {
        Entity product = productQuantitiesService.getProduct(neededProductQuantity.getKey());
        table.addCell(
                new Phrase(product.getStringField(ProductFields.NUMBER), FontUtils.getDejavuRegular7Dark()));
        table.addCell(
                new Phrase(product.getStringField(ProductFields.NAME), FontUtils.getDejavuRegular7Dark()));
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
        table.addCell(new Phrase(numberService.format(neededProductQuantity.getValue()),
                FontUtils.getDejavuBold7Dark()));
        table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
        String unit = product.getStringField(ProductFields.UNIT);
        if (unit == null) {
            table.addCell(new Phrase("", FontUtils.getDejavuRegular7Dark()));
        } else {
            table.addCell(new Phrase(unit, FontUtils.getDejavuRegular7Dark()));
        }
    }
    document.add(table);
}

From source file:com.qcadoo.mes.materialRequirements.print.pdf.MaterialRequirementPdfService.java

License:Open Source License

private void addOrderSeries(final Document document, final Entity materialRequirement,
        final Map<String, HeaderAlignment> headersWithAlignments) throws DocumentException {
    List<Entity> orders = materialRequirement.getManyToManyField(MaterialRequirementFields.ORDERS);
    Collections.sort(orders, new EntityOrderNumberComparator());

    List<String> headers = Lists.newLinkedList(headersWithAlignments.keySet());
    PdfPTable table = pdfHelper.createTableWithHeader(headersWithAlignments.size(), headers, true,
            defaultMatReqHeaderColumnWidth, headersWithAlignments);

    for (Entity order : orders) {
        table.addCell(new Phrase(order.getStringField(OrderFields.NUMBER), FontUtils.getDejavuRegular7Dark()));
        table.addCell(new Phrase(order.getStringField(OrderFields.NAME), FontUtils.getDejavuRegular7Dark()));
        Entity product = (Entity) order.getField(OrderFields.PRODUCT);
        if (product == null) {
            table.addCell(new Phrase("", FontUtils.getDejavuRegular7Dark()));
            BigDecimal plannedQuantity = order.getDecimalField(OrderFields.PLANNED_QUANTITY);
            plannedQuantity = (plannedQuantity == null) ? BigDecimal.ZERO : plannedQuantity;
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            table.addCell(new Phrase(numberService.format(plannedQuantity), FontUtils.getDejavuRegular7Dark()));
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
            table.addCell(new Phrase("", FontUtils.getDejavuRegular7Dark()));
        } else {/*from   ww  w . ja va  2  s. com*/
            table.addCell(
                    new Phrase(product.getStringField(ProductFields.NAME), FontUtils.getDejavuRegular7Dark()));
            BigDecimal plannedQuantity = order.getDecimalField(OrderFields.PLANNED_QUANTITY);
            plannedQuantity = (plannedQuantity == null) ? BigDecimal.ZERO : plannedQuantity;
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
            table.addCell(new Phrase(numberService.format(plannedQuantity), FontUtils.getDejavuRegular7Dark()));
            table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
            String unit = product.getStringField(ProductFields.UNIT);
            if (unit == null) {
                table.addCell(new Phrase("", FontUtils.getDejavuRegular7Dark()));
            } else {
                table.addCell(new Phrase(unit, FontUtils.getDejavuRegular7Dark()));
            }
        }

    }
    document.add(table);
}

From source file:com.qcadoo.mes.orders.print.OrderReportPdf.java

License:Open Source License

private void addTableToDocument(Document document, Entity orderEntity, Locale locale, String headerKey,
        Map<String, String> values) throws DocumentException {
    document.add(//ww  w  .j  av  a 2  s . com
            new Paragraph(translationService.translate(headerKey, locale), FontUtils.getDejavuBold10Dark()));

    Map<String, HeaderAlignment> headerValues = Maps.newLinkedHashMap();
    for (String key : values.keySet()) {
        headerValues.put(translationService.translate(String.format(L_TRANSLATION_PATH, key), locale),
                HeaderAlignment.LEFT);
    }

    PdfPTable table = pdfHelper.createTableWithHeader(values.size(), Lists.newArrayList(headerValues.keySet()),
            false, headerValues);
    table.getDefaultCell().disableBorderSide(PdfPCell.RIGHT);
    table.getDefaultCell().disableBorderSide(PdfPCell.LEFT);
    table.setHeaderRows(1);

    for (String value : values.values()) {
        table.addCell(createCell(value, Element.ALIGN_LEFT));
    }

    table.setSpacingAfter(20);

    document.add(table);
}

From source file:com.qcadoo.mes.productionCounting.print.ProductionBalancePdfService.java

License:Open Source License

private void addTableCellAsTable(final PdfPTable table, final String label, final Object fieldValue,
        final String nullValue, final Font headerFont, final Font valueFont, final DecimalFormat df) {
    PdfPTable cellTable = new PdfPTable(2);
    cellTable.getDefaultCell().setBorder(PdfPCell.NO_BORDER);
    cellTable.addCell(new Phrase(label, headerFont));
    Object value = fieldValue;/*from  w w w .j  av  a2 s . c o m*/
    if (value == null) {
        cellTable.addCell(new Phrase(nullValue, valueFont));
    } else {
        if (value instanceof BigDecimal && df != null) {
            cellTable.addCell(new Phrase(df.format(value), valueFont));
        } else {
            cellTable.addCell(new Phrase(value.toString(), valueFont));
        }
    }
    table.addCell(cellTable);
}

From source file:com.qcadoo.mes.productionCounting.print.ProductionBalancePdfService.java

License:Open Source License

public void addInputProductsBalance(final Document document, final Entity productionBalance,
        final Locale locale) throws DocumentException {
    List<String> inputProductsTableHeader = Lists.newArrayList();

    inputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.number", locale));
    inputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.productionName", locale));
    inputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.plannedQuantity", locale));
    inputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.usedQuantity", locale));
    inputProductsTableHeader//from  w  w  w.jav  a  2s .co  m
            .add(translationService.translate(L_PRODUCTION_BALANCE_REPORT_COLUMN_HEADER_BALANCE, locale));
    inputProductsTableHeader.add(translationService.translate("basic.product.unit.label", locale));

    Map<String, HeaderAlignment> alignments = Maps.newHashMap();
    alignments.put(translationService.translate(
            "productionCounting.productionBalance.report.columnHeader.number", locale), HeaderAlignment.LEFT);
    alignments.put(
            translationService.translate(
                    "productionCounting.productionBalance.report.columnHeader.productionName", locale),
            HeaderAlignment.LEFT);
    alignments.put(
            translationService.translate(
                    "productionCounting.productionBalance.report.columnHeader.plannedQuantity", locale),
            HeaderAlignment.RIGHT);
    alignments.put(
            translationService
                    .translate("productionCounting.productionBalance.report.columnHeader.usedQuantity", locale),
            HeaderAlignment.RIGHT);
    alignments.put(translationService.translate(PCPBRCHB_LITERAL, locale), HeaderAlignment.RIGHT);
    alignments.put(translationService.translate("basic.product.unit.label", locale), HeaderAlignment.LEFT);

    List<Entity> inputProductsList = productionBalance
            .getHasManyField(ProductionBalanceFields.BALANCE_OPERATION_PRODUCT_IN_COMPONENTS);

    if (!inputProductsList.isEmpty()) {
        document.add(new Paragraph(
                translationService.translate("productionCounting.productionBalance.report.paragraph", locale),
                FontUtils.getDejavuBold11Dark()));

        inputProductsList = Lists.newLinkedList(inputProductsList);

        PdfPTable inputProductsTable = pdfHelper.createTableWithHeader(6, inputProductsTableHeader, false,
                alignments);

        for (Entity inputProduct : inputProductsList) {
            inputProductsTable.addCell(
                    new Phrase(inputProduct.getBelongsToField(BalanceOperationProductInComponentFields.PRODUCT)
                            .getStringField(ProductFields.NUMBER), FontUtils.getDejavuRegular9Dark()));
            inputProductsTable.addCell(
                    new Phrase(inputProduct.getBelongsToField(BalanceOperationProductInComponentFields.PRODUCT)
                            .getStringField(ProductFields.NAME), FontUtils.getDejavuRegular9Dark()));

            inputProductsTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
            inputProductsTable.addCell(new Phrase(
                    numberService.format(
                            inputProduct.getField(BalanceOperationProductInComponentFields.PLANNED_QUANTITY)),
                    FontUtils.getDejavuRegular9Dark()));
            if (inputProduct.getField(BalanceOperationProductInComponentFields.USED_QUANTITY) == null) {
                inputProductsTable.addCell(new Phrase(L_N_A, FontUtils.getDejavuRegular9Dark()));
                inputProductsTable.addCell(new Phrase(L_N_A, FontUtils.getDejavuRegular9Dark()));
            } else {
                inputProductsTable.addCell(new Phrase(
                        numberService.format(
                                inputProduct.getField(BalanceOperationProductInComponentFields.USED_QUANTITY)),
                        FontUtils.getDejavuRegular9Dark()));
                inputProductsTable.addCell(new Phrase(
                        numberService.format(
                                inputProduct.getField(BalanceOperationProductInComponentFields.BALANCE)),
                        FontUtils.getDejavuRegular9Dark()));
            }
            inputProductsTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
            inputProductsTable.addCell(
                    new Phrase(inputProduct.getBelongsToField(BalanceOperationProductInComponentFields.PRODUCT)
                            .getStringField(ProductFields.UNIT), FontUtils.getDejavuRegular9Dark()));
        }

        document.add(inputProductsTable);
    }
}

From source file:com.qcadoo.mes.productionCounting.print.ProductionBalancePdfService.java

License:Open Source License

public void addOutputProductsBalance(final Document document, final Entity productionBalance,
        final Locale locale) throws DocumentException {

    List<String> outputProductsTableHeader = Lists.newArrayList();

    outputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.number", locale));
    outputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.productionName", locale));
    outputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.plannedQuantity", locale));
    outputProductsTableHeader.add(translationService
            .translate("productionCounting.productionBalance.report.columnHeader.producedQuantity", locale));
    outputProductsTableHeader/* ww w.j ava  2s .c o  m*/
            .add(translationService.translate(L_PRODUCTION_BALANCE_REPORT_COLUMN_HEADER_BALANCE, locale));
    outputProductsTableHeader.add(translationService.translate("basic.product.unit.label", locale));

    Map<String, HeaderAlignment> alignments = Maps.newHashMap();
    alignments.put(translationService.translate(
            "productionCounting.productionBalance.report.columnHeader.number", locale), HeaderAlignment.LEFT);

    alignments.put(
            translationService.translate(
                    "productionCounting.productionBalance.report.columnHeader.productionName", locale),
            HeaderAlignment.LEFT);

    alignments.put(
            translationService.translate(
                    "productionCounting.productionBalance.report.columnHeader.plannedQuantity", locale),
            HeaderAlignment.RIGHT);

    alignments.put(
            translationService.translate(
                    "productionCounting.productionBalance.report.columnHeader.producedQuantity", locale),
            HeaderAlignment.RIGHT);

    alignments.put(translationService.translate(PCPBRCHB_LITERAL, locale), HeaderAlignment.RIGHT);

    alignments.put(translationService.translate("basic.product.unit.label", locale), HeaderAlignment.LEFT);

    List<Entity> outputProductsList = productionBalance
            .getHasManyField(ProductionBalanceFields.BALANCE_OPERATION_PRODUCT_OUT_COMPONENTS);

    if (!outputProductsList.isEmpty()) {
        document.add(Chunk.NEWLINE);
        document.add(new Paragraph(
                translationService.translate("productionCounting.productionBalance.report.paragraph2", locale),
                FontUtils.getDejavuBold11Dark()));

        outputProductsList = Lists.newLinkedList(outputProductsList);

        PdfPTable outputProductsTable = pdfHelper.createTableWithHeader(6, outputProductsTableHeader, false,
                alignments);

        for (Entity outputProduct : outputProductsList) {
            outputProductsTable
                    .addCell(
                            new Phrase(
                                    outputProduct
                                            .getBelongsToField(
                                                    BalanceOperationProductOutComponentFields.PRODUCT)
                                            .getStringField(ProductFields.NUMBER),
                                    FontUtils.getDejavuRegular9Dark()));
            outputProductsTable
                    .addCell(
                            new Phrase(
                                    outputProduct
                                            .getBelongsToField(
                                                    BalanceOperationProductOutComponentFields.PRODUCT)
                                            .getStringField(ProductFields.NAME),
                                    FontUtils.getDejavuRegular9Dark()));

            outputProductsTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_RIGHT);
            outputProductsTable.addCell(new Phrase(
                    numberService.format(
                            outputProduct.getField(BalanceOperationProductOutComponentFields.PLANNED_QUANTITY)),
                    FontUtils.getDejavuRegular9Dark()));
            if (outputProduct.getField(BalanceOperationProductOutComponentFields.USED_QUANTITY) == null) {
                outputProductsTable.addCell(new Phrase(L_N_A, FontUtils.getDejavuRegular9Dark()));
                outputProductsTable.addCell(new Phrase(L_N_A, FontUtils.getDejavuRegular9Dark()));
            } else {
                outputProductsTable.addCell(new Phrase(
                        numberService.format(outputProduct
                                .getField(BalanceOperationProductOutComponentFields.USED_QUANTITY)),
                        FontUtils.getDejavuRegular9Dark()));
                outputProductsTable.addCell(new Phrase(
                        numberService.format(
                                outputProduct.getField(BalanceOperationProductOutComponentFields.BALANCE)),
                        FontUtils.getDejavuRegular9Dark()));
            }
            outputProductsTable.getDefaultCell().setHorizontalAlignment(PdfPCell.ALIGN_LEFT);
            outputProductsTable
                    .addCell(
                            new Phrase(
                                    outputProduct
                                            .getBelongsToField(
                                                    BalanceOperationProductOutComponentFields.PRODUCT)
                                            .getStringField(ProductFields.UNIT),
                                    FontUtils.getDejavuRegular9Dark()));
        }

        document.add(outputProductsTable);
    }
}

From source file:com.qcadoo.mes.productionCounting.print.ProductionTrackingReportPdfService.java

License:Open Source License

private void addTableCellAsTable(final PdfPTable table, final String label, final Object fieldValue,
        final String nullValue, final Font headerFont, final Font valueFont, final DecimalFormat df) {
    final PdfPTable cellTable = new PdfPTable(2);
    cellTable.getDefaultCell().setBorder(PdfPCell.NO_BORDER);
    cellTable.addCell(new Phrase(label, headerFont));
    final Object value = fieldValue;
    if (value == null) {
        cellTable.addCell(new Phrase(nullValue, valueFont));
    } else {//from   w w  w .j a  v  a 2  s  . com
        if (value instanceof BigDecimal && df != null) {
            cellTable.addCell(new Phrase(df.format(value), valueFont));
        } else {
            cellTable.addCell(new Phrase(value.toString(), valueFont));
        }
    }
    table.addCell(cellTable);
}