Example usage for com.lowagie.text Cell Cell

List of usage examples for com.lowagie.text Cell Cell

Introduction

In this page you can find the example usage for com.lowagie.text Cell Cell.

Prototype

public Cell(Element element) throws BadElementException 

Source Link

Document

Constructs a Cell with a certain Element.

if the element is a ListItem, Row or Cell, an exception will be thrown.

Usage

From source file:s2s.report.MiddleTable.java

License:GNU General Public License

public void addCellB(String strCaption, int iSize, int iColspan) throws BadElementException {
    strCaption = strCaption == null ? "" : strCaption;
    Cell cell = null;/* ww w  .j a va  2s  . co  m*/
    switch (iSize) {
    case 8:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText8B));
        break;
    case 9:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText9B));
        break;
    case 10:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText10B));
        break;
    case 11:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText11B));
        break;
    case 12:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText12B));
        break;
    case 13:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText13B));
        break;
    case 14:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText14B));
        break;
    case 15:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText15B));
        break;
    case 16:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText16B));
        break;
    case 17:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText17B));
        break;
    case 18:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText18B));
        break;
    case 19:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText19B));
        break;
    default:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText12B));
        break;
    }
    cell.setColspan(iColspan);
    this.addCell(cell);
}

From source file:s2s.report.MiddleTable.java

License:GNU General Public License

public void addCell(String strCaption, int iSize, int iColspan, int iRowspan) throws BadElementException {
    strCaption = strCaption == null ? "" : strCaption;
    Cell cell = null;/*from   w w  w .  ja  v a  2 s .c o  m*/
    switch (iSize) {
    case 8:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText8));
        break;
    case 9:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText9));
        break;
    case 10:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText10));
        break;
    case 11:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText11));
        break;
    case 12:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText12));
        break;
    case 13:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText13));
        break;
    case 14:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText14));
        break;
    case 15:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText15));
        break;
    case 16:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText16));
        break;
    case 17:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText17));
        break;
    case 18:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText18));
        break;
    case 19:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftText19));
        break;
    default:
        cell = new Cell(strCaption);
        break;
    }
    cell.setColspan(iColspan);
    cell.setRowspan(iRowspan);
    this.addCell(cell);
}

From source file:s2s.report.MiddleTable.java

License:GNU General Public License

public void addHeaderCellI(String strCaption, int iColspan, boolean bColor, int iSize)
        throws BadElementException {
    Cell cell = null;// w  ww  . j  av  a 2  s  .  c  om
    switch (iSize) {
    case 9:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader9I));
        break;
    case 12:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader12I));
        break;
    default:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeaderI));
        break;
    }
    if (bColor) {
        cell.setBackgroundColor(REPORT_SETTINGS.clTableHeader);
    }
    cell.setColspan(iColspan);
    this.addCell(cell);
}

From source file:s2s.report.MiddleTable.java

License:GNU General Public License

public void addHeaderCellBI(String strCaption, int iColspan, boolean bColor, int iSize)
        throws BadElementException {
    Cell cell = null;//from  w  w w.j  a  v a 2  s.  c om
    switch (iSize) {
    case 8:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader8BI));
        break;
    case 9:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader9BI));
        break;
    case 10:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader10BI));
        break;
    case 12:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeader12BI));
        break;
    default:
        cell = new Cell(new Phrase(strCaption, REPORT_SETTINGS.ftTableHeaderBI));
        break;
    }
    if (bColor) {
        cell.setBackgroundColor(REPORT_SETTINGS.clTableHeader);
    }
    cell.setColspan(iColspan);
    this.addCell(cell);
}

From source file:s2s.report.Report.java

License:GNU General Public License

public void writeParagrafo(String strName) throws BadElementException, DocumentException {
    Paragraph pr = new Paragraph("", REPORT_SETTINGS.ftParagraph2);
    //pr.setIndentationLeft(10f);

    Paragraph pr1 = new Paragraph(strName, REPORT_SETTINGS.ftTableHeader);
    pr1.setIndentationLeft(10f);/*from   ww  w.  j  av  a 2  s  . c  o m*/

    Cell cl = new Cell(pr1);
    cl.setBackgroundColor(REPORT_SETTINGS.clTableHeader);

    CenterMiddleTable tbl = new CenterMiddleTable(1);
    tbl.toLeft();
    tbl.addCell(cl);

    pr.add(tbl);
    m_document.add(pr);
}

From source file:sg.edu.nus.util.ReportWriter.java

private static void createTable(Section subCatPart) throws BadElementException {
    Table t = new Table(3, 2);

    t.setBorderColor(Color.GRAY);
    t.setPadding(4);// w  ww.  ja v a  2  s  . c  o m
    t.setSpacing(4);
    t.setBorderWidth(1);

    Cell c1 = new Cell("Table Header 1");
    c1.setHeader(true);
    t.addCell(c1);
    c1 = new Cell("Table Header 2");
    t.addCell(c1);
    c1 = new Cell("Table Header 3");
    t.addCell(c1);
    t.endHeaders();

    t.addCell("1.0");
    t.addCell("1.1");
    t.addCell("1.2");
    t.addCell("2.1");
    t.addCell("2.2");
    t.addCell("2.3");

    subCatPart.add(t);

}