use of com.itextpdf.layout.element.Table in project i7js-highlevel by itext.
the class TableProperties method createNewTable.
public Table createNewTable() {
Table table = new Table(UnitValue.createPercentArray(2)).useAllAvailableWidth();
table.addCell("test1");
table.addCell("test2");
table.addCell("test3");
table.addCell("test4");
table.addCell("test5");
table.addCell("test6");
table.addCell("test7");
table.addCell("This is a long text snippet that " + "will be used and reused to test paragraph " + "properties. This paragraph should take " + "more than one line. We'll change different " + "properties and then look at the effect " + "when we add the paragraph to the document.");
return table;
}
use of com.itextpdf.layout.element.Table in project ComponentManagement by Bac3Phi.
the class ReportPaymentController method addTablePayments.
private void addTablePayments(Document document) throws SQLException {
float[] pointColumnWidths = { 200F, 200F, 200F };
Table table = new Table(pointColumnWidths);
table.addCell(new Cell().add("Mã Chi Tiết Chi").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("Tổng Nhập").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
resultSet = dbConn.getData("select MaCTC, TenMH, TongNhap\n" + "from CHITIETCHI CTC join MATHANG MH on CTC.MaMH = MH.MaMH\n" + "where MaBCTC = '" + txtPaymentReportId.getText() + "'");
while (resultSet.next()) {
table.addCell(new Cell().add(resultSet.getString("MaCTC")).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("TongNhap"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
}
document.add(table);
}
use of com.itextpdf.layout.element.Table in project ComponentManagement by Bac3Phi.
the class ReportPaymentController method addTableRecetpts.
private void addTableRecetpts(Document document) throws SQLException {
float[] pointColumnWidths = { 200F, 200F, 200F };
Table table = new Table(pointColumnWidths);
table.addCell(new Cell().add("Mã Chi Tiết Thu").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("Tổng Bán").setTextAlignment(TextAlignment.CENTER).setFontSize(14).setFont(font_bold));
resultSet = dbConn.getData("select MaCTT, TenMH, TongBan\n" + "from CHITIETTHU CTT join MATHANG MH on CTT.MaMH = MH.MaMH\n" + "where MaBCTC = '" + txtPaymentReportId.getText() + "'");
while (resultSet.next()) {
table.addCell(new Cell().add(resultSet.getString("MaCTT")).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("TongBan"))).setTextAlignment(TextAlignment.RIGHT).setFontSize(12).setFont(font));
}
document.add(table);
}
use of com.itextpdf.layout.element.Table 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);
}
use of com.itextpdf.layout.element.Table 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);
}
Aggregations