Example usage for com.lowagie.text.pdf PdfPCell setColspan

List of usage examples for com.lowagie.text.pdf PdfPCell setColspan

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfPCell setColspan.

Prototype

public void setColspan(int colspan) 

Source Link

Document

Setter for property colspan.

Usage

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createNetPayable(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable createNetPayableTable = createNetPayableTable();
    createNetPayableTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell createNetPayableCell = new PdfPCell(createNetPayableTable);
    createNetPayableCell.setColspan(11);
    contractorBillMainTable.addCell(createNetPayableCell);
}

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createWorkValueData(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable createWorkValueDataTable = createWorkValueDataTable();
    createWorkValueDataTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell createWorkValueDataCell = new PdfPCell(createWorkValueDataTable);
    createWorkValueDataCell.setColspan(11);

    contractorBillMainTable.addCell(createWorkValueDataCell);
}

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createWorkValueLabel(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable WorkValueLabelTable = createWorkValueLabelTable();
    WorkValueLabelTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell WorkValueLabelCell = new PdfPCell(WorkValueLabelTable);
    WorkValueLabelCell.setColspan(11);
    contractorBillMainTable.addCell(WorkValueLabelCell);

}

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createDetailsForWorkOrderLabel(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable detailsForWorkOrderTable = createDetailsForWorkOrderLabelTable();
    detailsForWorkOrderTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell detailsForWorkOrderCell = new PdfPCell(detailsForWorkOrderTable);
    detailsForWorkOrderCell.setColspan(11);
    contractorBillMainTable.addCell(detailsForWorkOrderCell);
}

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createWorkDescRow(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable workDescTable = createWorkDescTable();
    workDescTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell workDescCell = new PdfPCell(workDescTable);
    workDescCell.setColspan(11);
    contractorBillMainTable.addCell(workDescCell);
}

From source file:org.egov.works.web.actions.contractorBill.ContractorBillPDFGenerator.java

License:Open Source License

protected void createContractorRow(final PdfPTable contractorBillMainTable) {
    contractorBillMainTable.getDefaultCell().setBorderWidth(1);
    final PdfPTable contractorTable = createContractorTable();
    contractorTable.getDefaultCell().setBorderWidth(1);
    final PdfPCell contractorCell = new PdfPCell(contractorTable);
    contractorCell.setColspan(11);
    contractorBillMainTable.addCell(contractorCell);
}

From source file:org.egov.works.web.actions.measurementbook.MeasurementBookPDFGenerator.java

License:Open Source License

private PdfPTable createMbTable() throws DocumentException {
    PdfPTable mbTable;/*from w  ww  . j  a va 2  s  .co  m*/
    if (includeRevisionTypeColumn) {
        mbTable = new PdfPTable(12);
        mbTable.setWidths(new float[] { 1f, 1.5f, 4f, 1.4f, 1.9f, 1.6f, 1.4f, 1.8f, 1.9f, 1.9f, 1.9f, 1.6f });
    } else {
        mbTable = new PdfPTable(11);
        mbTable.setWidths(new float[] { 1f, 1.5f, 4f, 1.9f, 1.6f, 1.4f, 1.8f, 1.9f, 1.9f, 1.9f, 1.6f });
    }
    // main table
    mbTable.setWidthPercentage(100);

    try {
        final Font font = new Font();
        font.setSize(8);
        mbTable.getDefaultCell().setPadding(3);
        mbTable.getDefaultCell().setBorderWidth(1);
        mbTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.slno"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.schno"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.descofwork"), font)));
        if (includeRevisionTypeColumn)
            mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.revisiontype"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.completedmeasurement"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.unitrate"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.unit"), font)));
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.totalvalueofcomplwork"), font)));

        // start creating tables for previous measurements
        final PdfPTable previousMbTable = createPreviousMbTable();
        final PdfPCell previousMbCell = new PdfPCell(previousMbTable);
        previousMbCell.setColspan(2);
        mbTable.addCell(previousMbCell);

        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.currentmeasurement"), font)));

        // last column
        mbTable.addCell(new PdfPCell(new Phrase(pdfLabel.get("mbpdf.currentcost"), font)));
    } catch (final RuntimeException e) {
        throw new ApplicationRuntimeException(MEASUREMENTBOOK_PDF_ERROR, e);
    }
    return mbTable;
}

From source file:org.egov.works.web.actions.tender.TenderNegotiationPDFGenerator.java

License:Open Source License

/**
 * create negotiation table main table//from   w w w  . ja  v a2  s  .c  om
 *
 * @param tenderResponse
 * @return
 * @throws DocumentException
 * @throws ApplicationException
 */
private PdfPTable createNegotiationTable(final TenderResponse tenderResponse, final Contractor contractor)
        throws DocumentException {
    final PdfPTable negotiationTable = new PdfPTable(13);
    negotiationTable.setWidthPercentage(100);
    negotiationTable.setWidths(
            new float[] { 0.5f, 1f, 3.6f, 1.5f, 1.1f, 0.9f, 1.5f, 1.7f, 1.7f, 1.7f, 1.7f, 1.7f, 1.7f });
    try {
        negotiationTable.getDefaultCell().setPadding(5);
        negotiationTable.getDefaultCell().setBorderWidth(1);
        negotiationTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
        negotiationTable.addCell(pdfLabel.get("tenderNegotiationpdf.slno"));
        negotiationTable.addCell(pdfLabel.get("tenderNegotiationpdf.scheduleno"));
        negotiationTable.addCell(pdfLabel.get("tenderNegotiationpdf.descofwork"));
        negotiationTable.addCell(pdfLabel.get("tenderNegotiationpdf.quantity"));

        /**
         * start creating tables for Estimate, before negotion, after negotiation and marketRate
         */

        final PdfPTable estimateTable = createAsPerEstimateTable(tenderResponse);
        estimateTable.setWidths(new float[] { 0.45f, 0.37f, 0.62f });
        final PdfPCell estimateCell = new PdfPCell(estimateTable);
        estimateCell.setColspan(3);
        negotiationTable.addCell(estimateCell);

        final PdfPTable beforeNegotiationTable = createBeforeNegotiationTable(tenderResponse);
        final PdfPCell beforeNegotiationCell = new PdfPCell(beforeNegotiationTable);
        beforeNegotiationCell.setColspan(2);
        negotiationTable.addCell(beforeNegotiationCell);

        final PdfPTable afterNegotiationTable = createAfterNegotiationTable(tenderResponse);
        final PdfPCell afterNegotiationCell = new PdfPCell(afterNegotiationTable);
        afterNegotiationCell.setColspan(2);
        negotiationTable.addCell(afterNegotiationCell);
        final PdfPTable marketRateTable = createMarketRateTable(tenderResponse);
        final PdfPCell marketRateCell = new PdfPCell(marketRateTable);
        marketRateCell.setColspan(2);
        negotiationTable.addCell(marketRateCell);
        /**
         * end creating tables for before negotion, after negotiation and marketRate
         */
        if (YES.equalsIgnoreCase(worksPackgeReq))
            createNegotiationTableDataForWp(tenderResponse, negotiationTable, contractor);
        else
            createNegotiationTableData(tenderResponse, negotiationTable, contractor);
        createNegotiationTableFooter(negotiationTable);
        addRowFooter(negotiationTable);
        addTotalQuotedFooter(negotiationTable);
        addFinalRow(negotiationTable, tenderResponse);
    } catch (final DocumentException e) {
        throw new ApplicationRuntimeException(TENDER_PDF_ERROR, e);
    }
    return negotiationTable;
}

From source file:org.egov.works.web.actions.tender.TenderNegotiationPDFGenerator.java

License:Open Source License

public void createNegotiationTableFooter(final PdfPTable negotiationTable) {
    negotiationTable.addCell(" ");
    negotiationTable.addCell(" ");
    final PdfPTable tenderTotalTable = createTenderTotalTable();
    final PdfPCell tenderTotalTableCell = new PdfPCell(tenderTotalTable);
    tenderTotalTableCell.setColspan(3);
    negotiationTable.addCell(tenderTotalTableCell);
    negotiationTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
    negotiationTable.addCell(" ");
    negotiationTable.addCell(rightPara(formatter.format(totalAmt)));
    negotiationTable.addCell(" ");
    negotiationTable.addCell(rightPara(formatter.format(totalBefNegAmt)));
    negotiationTable.addCell(" ");
    negotiationTable.addCell(rightPara(formatter.format(totalAftNegAmt)));
    negotiationTable.addCell(" ");
    negotiationTable.addCell(rightPara(formatter.format(totalMarketRateAmt)));
}

From source file:org.egov.works.web.actions.tender.TenderNegotiationPDFGenerator.java

License:Open Source License

public void addRowFooter(final PdfPTable negotiationTable) {
    negotiationTable.addCell(" ");
    negotiationTable.addCell(" ");
    final PdfPTable tenderPercentageTable = createTenderPercentageTable();
    final PdfPCell tenderPercentageTableCell = new PdfPCell(tenderPercentageTable);
    tenderPercentageTableCell.setColspan(5);
    negotiationTable.addCell(tenderPercentageTableCell);
    negotiationTable.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
    final PdfPTable befTenderNegFormulaTable = createBefTenderNegFormulaTable();
    final PdfPCell befTenderNegFormulaTableCell = new PdfPCell(befTenderNegFormulaTable);
    befTenderNegFormulaTableCell.setColspan(2);
    negotiationTable.addCell(befTenderNegFormulaTableCell);
    final PdfPTable aftTenderNegFormulaTable = createAftTenderNegFormulaTable();
    final PdfPCell aftTenderNegFormulaTableCell = new PdfPCell(aftTenderNegFormulaTable);
    aftTenderNegFormulaTableCell.setColspan(2);
    negotiationTable.addCell(aftTenderNegFormulaTableCell);
    final PdfPTable marketTenderNegFormulaTable = createMarketTenderNegFormulaTable();
    final PdfPCell marketTenderNegFormulaTableCell = new PdfPCell(marketTenderNegFormulaTable);
    marketTenderNegFormulaTableCell.setColspan(2);
    negotiationTable.addCell(marketTenderNegFormulaTableCell);
}