Example usage for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment

List of usage examples for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfPTable setHorizontalAlignment.

Prototype

public void setHorizontalAlignment(final int horizontalAlignment) 

Source Link

Document

Sets the horizontal alignment of the table relative to the page.

Usage

From source file:Visao.relatorios.GerarRelatorioMadeiraPraca.java

private void GerarPDF() throws DocumentException, FileNotFoundException {
    try {/*w  w  w .  j a va2s .  co m*/
        int linha = jTableMadeiraEstoquePraca.getSelectedRow();
        Document document = new Document(PageSize.A4, 10, 10, 10, 10);
        //System.out.println(new File(".").getAbsolutePath());
        String arquivo = new File("Relatorio Madeira Praa.").getAbsolutePath() + "pdf";
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(arquivo));
        document.open();
        Font font = new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD);
        //String titulo = jTableRelatorioEstoquePrincipal.getValueAt(linha, 3).toString()+ " "+jTableRelatorioEstoquePrincipal.getValueAt(linha, 2).toString()+"-"+jTableRelatorioEstoquePrincipal.getValueAt(linha, 0).toString();
        String titulo = "Relatorio Madeira Praa";
        Paragraph pgt = new Paragraph(titulo, font);
        pgt.setAlignment(Element.ALIGN_CENTER);
        document.add(pgt);
        document.add(new Paragraph(" "));
        /*if(!filtro_matgen.equals("")){
            titulo = "Material genetico "+filtro_matgen;
        }*/
        PdfPTable table = new PdfPTable(colunas.length);
        // Definindo uma fonte, com tamanho 20 e negrito
        PdfPCell header = new PdfPCell(new Paragraph(titulo, font));
        header.setColspan(colunas.length);
        table.addCell(header);
        table.setWidthPercentage(100.0f);
        table.setHorizontalAlignment(Element.ALIGN_JUSTIFIED_ALL);
        //System.out.println("Tamanho: "+linhas.size());
        font = new Font(Font.FontFamily.TIMES_ROMAN, 4, Font.NORMAL);
        for (String coluna : colunas) {
            table.addCell(new Paragraph(coluna, font));
        }

        //varias linhas
        for (int i = 0; i < linhas.size(); i++) {//linha
            for (int j = 0; j < colunas.length; j++) {//coluna
                //table.addCell(jTableRelatorioEstoquePrincipal.getValueAt(i, j).toString());
                table.addCell(new Paragraph(jTableMadeiraEstoquePraca.getValueAt(i, j).toString(), font));
            }
        }

        document.add(table);
        document.add(new Paragraph(" "));

        font = new Font(Font.FontFamily.TIMES_ROMAN, 12, Font.BOLD);
        document.add(new Paragraph("Dados Totais", font));
        font = new Font(Font.FontFamily.TIMES_ROMAN, 8, Font.NORMAL);
        document.add(new Paragraph(jLabelInfo1.getText(), font));
        document.add(new Paragraph(jLabelMStereoTotal.getText(), font));
        document.add(new Paragraph(jLabelM3Total.getText(), font));
        document.add(new Paragraph(jLabelPesoTotal.getText(), font));

        document.close();
        JOptionPane.showMessageDialog(null, "PDF: " + arquivo + " gerado!");
    } catch (FileNotFoundException | DocumentException | HeadlessException ex) {
        Logger.getLogger(GerarRelatorioEstoqueBasico.class.getName()).log(Level.SEVERE, null,
                "Erro ao gerar pdf: " + ex);
        JOptionPane.showMessageDialog(null, "Erro ao gerar pdf: " + ex);
    }

}

From source file:Vista.GenerarPDF.java

private void btngenerarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btngenerarActionPerformed
    String nave = "" + cmbtiponave.getSelectedItem();
    String ruta = txtruta.getText();
    try {//from  ww  w .  java 2s .c  o  m
        FileOutputStream archivo = new FileOutputStream(ruta + ".pdf");

        Document doc = new Document();
        PdfWriter.getInstance(doc, archivo);
        doc.open();
        Paragraph parrafo2 = new Paragraph("INFORME DE MANTENIMIENTOS");
        parrafo2.setAlignment(1);//el 1 es para centrar
        doc.add(parrafo2);

        doc.add(new Phrase(Chunk.NEWLINE));
        doc.add(new Phrase(Chunk.NEWLINE));

        doc.add(new Paragraph(
                "Acontinuacion se muestra una lista de los mantenimientos realizados a la aeronave " + nave
                        + ""));
        doc.add(new Phrase(Chunk.NEWLINE));
        PdfPTable tabla = new PdfPTable(6);
        tabla.setHorizontalAlignment(Element.ALIGN_CENTER);
        tabla.setTotalWidth(PageSize.A4.getWidth() - 10);
        //el numero indica la cantidad de Columnas

        tabla.addCell("ID");
        tabla.addCell("Matricula");
        tabla.addCell("Estado");
        tabla.addCell("Tareas");
        tabla.addCell("Fecha inicio");
        tabla.addCell("Fecha termino");
        tabla.setWidths(new int[] { 1, 2, 4, 4, 3, 3 });
        Administrar_Mantenimientos av = new Administrar_Mantenimientos();

        ArrayList<Detalle_Mantenimiento> listaMantenimientos = av.listarMantenimientosMatricula(nave);
        for (int i = 0; i < listaMantenimientos.size(); i++) {
            tabla.addCell(String.valueOf(listaMantenimientos.get(i).getId()));
            tabla.addCell(listaMantenimientos.get(i).getMatricula());
            tabla.addCell(listaMantenimientos.get(i).getEstado());
            tabla.addCell(listaMantenimientos.get(i).getTareas_seleccionadas());
            tabla.addCell(listaMantenimientos.get(i).getFecha_inicio());
            tabla.addCell(listaMantenimientos.get(i).getFecha_termino());
        }

        // esto nos crea una tabla de 3 Columnas por 2 Filas
        doc.add(tabla);
        doc.close();
        JOptionPane.showMessageDialog(null, "PDF CREADO CON EXITO");

    } catch (Exception e) {
        System.out.println("error" + e);
    }

}

From source file:voedselbank.OverzichtScherm.java

private void exporteerKnopActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exporteerKnopActionPerformed

    try {//from w  ww  . j  ava2  s .c  o  m
        JFileChooser chooser = new JFileChooser();
        chooser.setCurrentDirectory(new java.io.File("."));
        chooser.setDialogTitle("Kies een locatie");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);

        if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
            Document doc = new Document();

            Rectangle rect = new Rectangle(PageSize.A4.rotate());
            PdfWriter.getInstance(doc, new FileOutputStream(chooser.getSelectedFile() + "/overzicht.pdf"));

            doc.setPageSize(rect);
            doc.open();

            PdfPTable pdfTable = new PdfPTable(overzichtTabel.getColumnCount());
            pdfTable.setWidthPercentage(108);
            pdfTable.setHorizontalAlignment(Element.ALIGN_CENTER);

            //adding table headers
            for (int i = 0; i < overzichtTabel.getColumnCount(); i++) {
                PdfPCell head = new PdfPCell(new Paragraph(overzichtTabel.getColumnName(i)));
                head.setHorizontalAlignment(Element.ALIGN_CENTER);
                head.setBackgroundColor(new BaseColor(236, 116, 4));
                pdfTable.addCell(head);
            }

            //extracting data from the JTable and inserting it to PdfPTable
            for (int rows = 0; rows < overzichtTabel.getRowCount(); rows++) {
                for (int cols = 0; cols < overzichtTabel.getColumnCount(); cols++) {
                    pdfTable.addCell(overzichtTabel.getModel().getValueAt(rows, cols).toString());
                }
            }

            doc.add(pdfTable);
            doc.close();
            System.out.println("Done");
        } else {
            System.out.println("U heeft niks geselecteerd.");
        }
    } catch (FileNotFoundException | DocumentException e) {
        e.printStackTrace();
    }
}

From source file:WeeklyReport.Sections.Commodities.java

public PdfPTable commoditySectionIntroduction() {
    PdfPTable table = new PdfPTable(1);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);/*w  w  w .  j  a v a 2 s.c o m*/
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("COMMODITIES", SECTION_HEADING));
    cell.setColspan(1);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    // Get the top two commodities from the HashMap
    Map<String, String> m = new CargoTypeData().topTwoCommodities();
    //ArrayList to add the commodities to
    ArrayList<String> commodities = new ArrayList<>();
    m.entrySet().stream().forEach((entry) -> {
        commodities.add(entry.getKey());
    });

    cell = new PdfPCell(new Phrase("During week " + new ReportingDates().reportPeriod() + " a total of "
            + new CustomerQuoteData().totalQuotes()
            + " were generated through RQS. Of these quotes the top two commodity classes quoted were "
            + commodities.get(0) + " and " + commodities.get(1)
            + ". The below table depicts the top ten commodities quoted during week "
            + new ReportingDates().reportPeriod() + ".", TEXT_FONT));
    cell.setColspan(1);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    return table;
}

From source file:WeeklyReport.Sections.Commodities.java

public PdfPTable byCommodityTable() {
    PdfPTable table = new PdfPTable(2);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);//from ww w .  j  a  v  a2 s  .  c  om
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("Quotes by Commodity", SUBHEADING_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(2);
    cell.setPaddingBottom(10f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    Map<String, String> m = new CargoTypeData().quotesByCommodity();
    m.entrySet().stream().forEach((entry) -> {
        cell = new PdfPCell(new Phrase(entry.getKey(), TEXT_FONT));
        cell.setColspan(1);
        cell.setBorder(Rectangle.BOTTOM);
        table.addCell(cell);

        cell = new PdfPCell(new Phrase(entry.getValue(), TEXT_FONT));
        cell.setColspan(1);
        cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cell.setBorder(Rectangle.BOTTOM);
        table.addCell(cell);
    });
    return table;
}

From source file:WeeklyReport.Sections.RegionalQuoteData.java

public PdfPTable regionalAnalysis() {
    PdfPTable table = new PdfPTable(1);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);//  www  .  ja v a 2  s  . co m
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("Regional Quote Data", SECTION_HEADING));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    cell.setPaddingBottom(10f);
    table.addCell(cell);

    String pending = null;

    if (PENDING_RESPONSE == 1) {
        pending = PENDING_RESPONSE + " is pending further action.";
    } else {
        pending = PENDING_RESPONSE + " are pending further action.";
    }

    cell = new PdfPCell(new Phrase("In week " + new ReportingDates().reportPeriod() + " a total of "
            + new CustomerQuoteData().totalNAQuotes()
            + " quotes were generated through RQS to North American customers (not including Canada). Of these quotes there were "
            + DECLINES + " declines, " + BOOKINGS + " bookings, and " + FEEDBACK
            + " received customer feedback, and " + pending, TEXT_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_JUSTIFIED);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    return table;

}

From source file:WeeklyReport.Sections.RegionalQuoteData.java

public PdfPTable southeastTable() {
    PdfPTable table = new PdfPTable(4);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);/*from w ww .  j a v  a 2 s  .  c  o m*/

    cell = new PdfPCell(new Phrase("South East", SUBHEADING_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(4);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Company Name", COLUMN_HEADER));
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Trade Lane", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Unit Count", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Cubic Meters", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    Map<Map<String, String>, Map<String, String>> m = SOUTH_EAST_QUOTES;
    m.entrySet().stream().map((entry) -> {
        Map<String, String> m1 = entry.getKey();
        m1.entrySet().stream().map((pair) -> {
            companyCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            tradeCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
        });
        return entry;
    }).map((entry) -> {
        companyCell.setColspan(1);
        tradeCell.setColspan(1);
        return entry;
    }).map((entry) -> {
        companyCell.setBorder(Rectangle.BOTTOM);
        tradeCell.setBorder(Rectangle.BOTTOM);
        return entry;
    }).map((entry) -> {
        table.addCell(companyCell);
        table.addCell(tradeCell);
        Map<String, String> m1 = entry.getValue();
        m1.entrySet().stream().map((pair) -> {
            unitCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            cubicMetersCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
        });
        return entry;
    }).map((_item) -> {
        unitCell.setColspan(1);
        cubicMetersCell.setColspan(1);
        return _item;
    }).map((_item) -> {
        unitCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cubicMetersCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        return _item;
    }).map((_item) -> {
        unitCell.setBorder(Rectangle.BOTTOM);
        cubicMetersCell.setBorder(Rectangle.BOTTOM);
        return _item;
    }).forEach((_item) -> {
        table.addCell(unitCell);
        table.addCell(cubicMetersCell);
    });
    return table;
}

From source file:WeeklyReport.Sections.RegionalQuoteData.java

public PdfPTable northEastTable() {
    PdfPTable table = new PdfPTable(4);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);//from w w  w.  j a v  a2s . c  o  m
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("North East", SUBHEADING_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(4);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Company Name", COLUMN_HEADER));
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Trade Lane", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Unit Count", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Cubic Meters", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    Map<Map<String, String>, Map<String, String>> m = NORTH_EAST_QUOTES;
    m.entrySet().stream().map((entry) -> {
        Map<String, String> m1 = entry.getKey();
        m1.entrySet().stream().map((pair) -> {
            companyCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            tradeCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
        });
        return entry;
    }).map((entry) -> {
        companyCell.setColspan(1);
        tradeCell.setColspan(1);
        return entry;
    }).map((entry) -> {
        companyCell.setBorder(Rectangle.BOTTOM);
        tradeCell.setBorder(Rectangle.BOTTOM);
        return entry;
    }).map((entry) -> {
        table.addCell(companyCell);
        table.addCell(tradeCell);
        Map<String, String> m1 = entry.getValue();
        m1.entrySet().stream().map((pair) -> {
            unitCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            cubicMetersCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
        });
        return entry;
    }).map((_item) -> {
        unitCell.setColspan(1);
        cubicMetersCell.setColspan(1);
        return _item;
    }).map((_item) -> {
        unitCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cubicMetersCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        return _item;
    }).map((_item) -> {
        unitCell.setBorder(Rectangle.BOTTOM);
        cubicMetersCell.setBorder(Rectangle.BOTTOM);
        return _item;
    }).forEach((_item) -> {
        table.addCell(unitCell);
        table.addCell(cubicMetersCell);
    });
    return table;
}

From source file:WeeklyReport.Sections.RegionalQuoteData.java

public PdfPTable midWestTable() {
    PdfPTable table = new PdfPTable(4);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);/*from w w  w.  ja  va 2s. c  om*/
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("Mid West", SUBHEADING_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(4);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Company Name", COLUMN_HEADER));
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Trade Lane", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Unit Count", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Cubic Meters", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    Map<Map<String, String>, Map<String, String>> m = MID_WEST_QUOTES;
    m.entrySet().stream().map((entry) -> {
        Map<String, String> m1 = entry.getKey();
        m1.entrySet().stream().map((pair) -> {
            companyCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            tradeCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
        });
        return entry;
    }).map((entry) -> {
        companyCell.setColspan(1);
        tradeCell.setColspan(1);
        return entry;
    }).map((entry) -> {
        companyCell.setBorder(Rectangle.BOTTOM);
        tradeCell.setBorder(Rectangle.BOTTOM);
        return entry;
    }).map((entry) -> {
        table.addCell(companyCell);
        table.addCell(tradeCell);
        Map<String, String> m1 = entry.getValue();
        m1.entrySet().stream().map((pair) -> {
            unitCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            cubicMetersCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
        });
        return entry;
    }).map((_item) -> {
        unitCell.setColspan(1);
        cubicMetersCell.setColspan(1);
        return _item;
    }).map((_item) -> {
        unitCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cubicMetersCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        return _item;
    }).map((_item) -> {
        unitCell.setBorder(Rectangle.BOTTOM);
        cubicMetersCell.setBorder(Rectangle.BOTTOM);
        return _item;
    }).forEach((_item) -> {
        table.addCell(unitCell);
        table.addCell(cubicMetersCell);
    });
    return table;
}

From source file:WeeklyReport.Sections.RegionalQuoteData.java

public PdfPTable westCoastTable() {
    PdfPTable table = new PdfPTable(4);
    table.setHorizontalAlignment(Element.ALIGN_MIDDLE);
    table.setWidthPercentage(100f);/*  w ww  . java  2 s.  c  o m*/
    table.setSpacingBefore(10f);

    cell = new PdfPCell(new Phrase("West Coast", SUBHEADING_FONT));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER);
    cell.setColspan(4);
    cell.setBorder(Rectangle.NO_BORDER);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Company Name", COLUMN_HEADER));
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Trade Lane", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_LEFT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Unit Count", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    cell = new PdfPCell(new Phrase("Cubic Meters", COLUMN_HEADER));
    cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
    cell.setPaddingBottom(5f);
    cell.setBorder(Rectangle.BOTTOM);
    cell.setBorderWidthBottom(2f);
    table.addCell(cell);

    Map<Map<String, String>, Map<String, String>> m = WEST_COAST_QUOTES;
    m.entrySet().stream().map((entry) -> {
        Map<String, String> m1 = entry.getKey();
        m1.entrySet().stream().map((pair) -> {
            companyCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            tradeCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
        });
        return entry;
    }).map((entry) -> {
        companyCell.setColspan(1);
        tradeCell.setColspan(1);
        return entry;
    }).map((entry) -> {
        companyCell.setBorder(Rectangle.BOTTOM);
        tradeCell.setBorder(Rectangle.BOTTOM);
        return entry;
    }).map((entry) -> {
        table.addCell(companyCell);
        table.addCell(tradeCell);
        Map<String, String> m1 = entry.getValue();
        m1.entrySet().stream().map((pair) -> {
            unitCell = new PdfPCell(new Phrase(String.valueOf(pair.getKey()), TEXT_FONT));
            return pair;
        }).forEach((pair) -> {
            cubicMetersCell = new PdfPCell(new Phrase(String.valueOf(pair.getValue()), TEXT_FONT));
        });
        return entry;
    }).map((_item) -> {
        unitCell.setColspan(1);
        cubicMetersCell.setColspan(1);
        return _item;
    }).map((_item) -> {
        unitCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        cubicMetersCell.setHorizontalAlignment(Element.ALIGN_RIGHT);
        return _item;
    }).map((_item) -> {
        unitCell.setBorder(Rectangle.BOTTOM);
        cubicMetersCell.setBorder(Rectangle.BOTTOM);
        return _item;
    }).forEach((_item) -> {
        table.addCell(unitCell);
        table.addCell(cubicMetersCell);
    });
    return table;
}