Search in sources :

Example 31 with Cell

use of com.itextpdf.layout.element.Cell in project ComponentManagement by Bac3Phi.

the class ReportPaymentController method addTable.

private void addTable(Document document) throws SQLException {
    float[] pointColumnWidths = { 200F, 200F, 200F, 200F, 200F, 200F, 200F };
    Table table = new Table(pointColumnWidths);
    table.addCell(new Cell().add("Mã BCTC").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Nhân Viên").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tổng Thu").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tổng Chi").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Ngày Lập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Loại Báo Cáo").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Thời Gian").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    ReceiptsAndPaymentsReport selectedRow = tbvReport.getSelectionModel().getSelectedItem();
    table.addCell(new Cell().add(selectedRow.getReportID()).setTextAlignment(TextAlignment.LEFT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(selectedRow.getEmployeeName()).setTextAlignment(TextAlignment.LEFT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumReceipts())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumPayments())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getPublishDate())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(selectedRow.getType()).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(selectedRow.getDate()).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    document.add(table);
}
Also used : Table(com.itextpdf.layout.element.Table) Cell(com.itextpdf.layout.element.Cell)

Example 32 with Cell

use of com.itextpdf.layout.element.Cell in project ComponentManagement by Bac3Phi.

the class InventoriesReportController method addTable.

private void addTable(Document document) throws SQLException {
    float[] pointColumnWidths = { 200F, 200F, 200F, 200F, 200F, 200F, 200F };
    Table table = new Table(pointColumnWidths);
    table.addCell(new Cell().add("Mã BCHT").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Ngày lập").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Tháng").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Tên nhân viên lập").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Tổng nhập").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Tổng bán").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    table.addCell(new Cell().add("Tổng tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14));
    InventoriesReport selectedRow = tbvReport.getSelectionModel().getSelectedItem();
    table.addCell(new Cell().add(selectedRow.getReportID()).setTextAlignment(TextAlignment.LEFT).setFontSize(12));
    table.addCell(new Cell().add(selectedRow.getPublishDate().toString()).setTextAlignment(TextAlignment.LEFT));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getReportMonth())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getEmployeeName())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumImport())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumSell())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumStock())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12));
    document.add(table);
}
Also used : Table(com.itextpdf.layout.element.Table) Cell(com.itextpdf.layout.element.Cell)

Example 33 with Cell

use of com.itextpdf.layout.element.Cell in project ComponentManagement by Bac3Phi.

the class ReportInventoriesController method addTableInventories.

private void addTableInventories(Document document) throws SQLException {
    float[] pointColumnWidths = { 200F, 200F, 200F, 200F, 200F };
    Table table = new Table(pointColumnWidths);
    table.addCell(new Cell().add("Mã Chi Tiết Hàng Tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tên Mặt Hàng").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Lượng Nhập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Lượng Bán").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Lượng Tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    resultSet = dbConn.getData("SELECT CTBCHT.MaCTBC, MH.TenMH, SUM(CTPN.SoLuong) AS LuongNhapBĐ, SUM(CTHD.SoLuong) AS LuongBan, SUM(MH.SoLuong) AS LuongTon FROM CHITIETBAOCAOHANGTON CTBCHT JOIN MATHANG MH JOIN CHITIETPHIEUNHAP CTPN JOIN CHITIETHOADON CTHD ON CTBCHT.MaMH = MH.MaMH AND CTPN.MaMH = CTBCHT.MaMH AND CTHD.MaMH = CTBCHT.MaMH WHERE MaBCHT = '" + txtReportID.getText() + "'" + "GROUP BY TenMH;");
    while (resultSet.next()) {
        table.addCell(new Cell().add(resultSet.getString("MaCTBC")).setTextAlignment(TextAlignment.LEFT).setFontSize(12)).setFont(font);
        table.addCell(new Cell().add(resultSet.getString("TenMH")).setTextAlignment(TextAlignment.LEFT).setFontSize(12)).setFont(font);
        table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongNhapBĐ"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12)).setFont(font);
        table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongBan"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12)).setFont(font);
        table.addCell(new Cell().add(String.valueOf(resultSet.getLong("LuongTon"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12)).setFont(font);
    }
    document.add(table);
}
Also used : Table(com.itextpdf.layout.element.Table) Cell(com.itextpdf.layout.element.Cell)

Example 34 with Cell

use of com.itextpdf.layout.element.Cell in project ComponentManagement by Bac3Phi.

the class ReportInventoriesController method addTable.

private void addTable(Document document) throws SQLException {
    float[] pointColumnWidths = { 200F, 200F, 200F, 200F, 200F, 200F, 200F };
    Table table = new Table(pointColumnWidths);
    table.addCell(new Cell().add("Mã BCHT").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Ngày lập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tháng").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tên nhân viên lập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tổng nhập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tổng bán").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    table.addCell(new Cell().add("Tổng tồn").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
    InventoriesReport selectedRow = tbvReport.getSelectionModel().getSelectedItem();
    table.addCell(new Cell().add(selectedRow.getReportID()).setTextAlignment(TextAlignment.LEFT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(selectedRow.getPublishDate().toString()).setTextAlignment(TextAlignment.LEFT).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getReportMonth())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getEmployeeName())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumImport())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumSell())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    table.addCell(new Cell().add(String.valueOf(selectedRow.getSumStock())).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
    document.add(table);
}
Also used : Table(com.itextpdf.layout.element.Table) Cell(com.itextpdf.layout.element.Cell)

Aggregations

Cell (com.itextpdf.layout.element.Cell)34 Table (com.itextpdf.layout.element.Table)29 PdfDocument (com.itextpdf.kernel.pdf.PdfDocument)21 PdfWriter (com.itextpdf.kernel.pdf.PdfWriter)21 Document (com.itextpdf.layout.Document)21 Paragraph (com.itextpdf.layout.element.Paragraph)21 CsvTo2DList (com.itextpdf.highlevel.util.CsvTo2DList)6 List (java.util.List)6 Image (com.itextpdf.layout.element.Image)4 DottedBorder (com.itextpdf.layout.borders.DottedBorder)3 SolidBorder (com.itextpdf.layout.borders.SolidBorder)3 IOException (java.io.IOException)3 DashedBorder (com.itextpdf.layout.borders.DashedBorder)2 File (java.io.File)2 BarcodeEAN (com.itextpdf.barcodes.BarcodeEAN)1 ImageData (com.itextpdf.io.image.ImageData)1 PdfFont (com.itextpdf.kernel.font.PdfFont)1 Style (com.itextpdf.layout.Style)1 AreaBreak (com.itextpdf.layout.element.AreaBreak)1 Link (com.itextpdf.layout.element.Link)1