Example usage for com.lowagie.text PageSize B3

List of usage examples for com.lowagie.text PageSize B3

Introduction

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

Prototype

Rectangle B3

To view the source code for com.lowagie.text PageSize B3.

Click Source Link

Document

This is the b3 format

Usage

From source file:com.afunms.report.abstraction.ExcelReport1.java

/**
 * @param filename//from  w  w w . j a  va 2s.c  om
 * @param type
 * @throws DocumentException
 * @throws IOException
 */
public void createReport_inforNewDoc(String filename, String type) throws DocumentException, IOException {
    String hostname = (String) reportHash.get("dbname");
    String hostnamestr = (String) reportHash.get("dbnamestr");
    String ip = (String) reportHash.get("ip");
    String typename = (String) reportHash.get("typename");
    String Ping = (String) reportHash.get("Ping");
    String starttime = (String) reportHash.get("starttime");
    String totime = (String) reportHash.get("totime");
    Hashtable oramem = (Hashtable) reportHash.get("memvalue");
    Hashtable maxping = (Hashtable) reportHash.get("ping");
    SybaseVO sysbaseVO = (SybaseVO) reportHash.get("sysbaseVO");
    String runstr = (String) reportHash.get("runstr");
    String[] sysItem1 = { "shared pool", "large pool", "buffer cache", "java pool" };
    String downnum = (String) reportHash.get("downnum");
    Hashtable dbinfo = new Hashtable();
    dbinfo = (Hashtable) reportHash.get("dbValue");
    ArrayList dbspaces = new ArrayList();
    dbspaces = (ArrayList) dbinfo.get("informixspaces");// 
    DBTypeDao typedao = new DBTypeDao();
    DBTypeVo typevo = typedao.findByDbtype("informix");
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Document document = null;
    // (Writer)document(Writer)
    if ("pdf".equals(type)) {
        document = new Document(PageSize.B3);
        PdfWriter.getInstance(document, new FileOutputStream(filename));
    } else {
        document = new Document(PageSize.A4);
        RtfWriter2.getInstance(document, new FileOutputStream(filename));
    }
    document.open();
    // 
    BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
    // 
    Font titleFont = new Font(bfChinese, 12, Font.BOLD);
    // 
    Font contextFont1 = new Font(bfChinese, 12, Font.NORMAL);
    Font fontChinese = new Font(bfChinese, 12, Font.NORMAL, Color.black);
    Table aTable = new Table(8);
    // float[] widths = { 220f, 220f, 220f, 110f, 110f, 110f, 110f, 220f };
    // aTable.setWidths(widths);
    // aTable.setWidth(100); //  90%
    // aTable.setAlignment(Element.ALIGN_CENTER);// 
    // aTable.setAutoFillEmptyCells(true); // 
    // aTable.setBorderWidth(1); // 
    // aTable.setBorderColor(new Color(0, 125, 255)); // 
    // aTable.setPadding(2);// 
    // aTable.setSpacing(0);// 
    // aTable.setBorder(2);// 
    this.setTableFormat(aTable);
    Cell cell = null;

    cell = new Cell(new Phrase("\n" + "" + hostname + "" + "\n", titleFont));
    cell.setColspan(8);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + "\n", titleFont));
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + starttime + "" + totime + "\n", contextFont1));
    cell.setColspan(7);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + "\n", titleFont));
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase(hostnamestr, contextFont1));
    this.setCellFormat(cell, false);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("IP", titleFont));
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase(ip, contextFont1));
    cell.setColspan(2);
    this.setCellFormat(cell, false);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase(typename, contextFont1));
    this.setCellFormat(cell, false);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase(runstr, contextFont1));
    cell.setColspan(2);
    this.setCellFormat(cell, false);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    String grade = (String) reportHash.get("grade");
    cell = new Cell(new Phrase(grade, contextFont1));
    cell.setColspan(3);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("" + "\n" + "" + "\n" + "" + "\n" + "", titleFont));
    cell.setRowspan(5);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setRowspan(4);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(MB)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(MB)", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("Metadata(MB)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(MB)", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(MB)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(%)", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(%)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setRowspan(1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    // 

    InformixspaceconfigDao informixspaceconfigDao = new InformixspaceconfigDao();

    List list = null;
    try {
        list = informixspaceconfigDao.getByIp(ip, 1);
    } catch (Exception e) {
        SysLogger.error("", e);
    } finally {
        informixspaceconfigDao.close();
    }

    Cell cell5 = new Cell(new Phrase("" + "\n" + "" + "\n" + "" + "\n" + "", titleFont));
    this.setCellFormat(cell5, true);
    cell5.setRowspan(15 + list.size());
    aTable.addCell(cell5);
    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) maxping.get("avgpingcon"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) maxping.get("pingmax"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    // io
    ArrayList dbabout = new ArrayList();
    dbabout = (ArrayList) dbinfo.get("aboutlist");// 

    Hashtable hashtable = new Hashtable();
    if (dbabout != null && dbabout.size() > 0) {
        for (int i = 0; i < dbabout.size(); i++) {
            Hashtable tablesVO = (Hashtable) dbabout.get(i);
            String name = ((String) tablesVO.get("name")).trim();
            String desc = "";
            if ("dskreads".equals(name)) {
                desc = "";
                hashtable.put("dskreads", tablesVO.get("value"));
            } else if ("bufreads".equals(name)) {
                desc = "";
                hashtable.put("bufreads", tablesVO.get("value"));
            } else if ("dskwrites".equals(name)) {
                desc = "";
                hashtable.put("dskwrites", tablesVO.get("value"));
            } else if ("bufwrites".equals(name)) {
                desc = "";
                hashtable.put("bufwrites", tablesVO.get("value"));
            } else if ("isamtot".equals(name)) {
                desc = "";
                hashtable.put("isamtot", tablesVO.get("value"));
            } else if ("isopens".equals(name)) {
                desc = "isopen";
                hashtable.put("isopens", tablesVO.get("value"));
            } else if ("isstarts".equals(name)) {
                desc = "isstart";
                hashtable.put("isstarts", tablesVO.get("value"));
            } else if ("isreads".equals(name)) {
                desc = "isread";
                hashtable.put("isreads", tablesVO.get("value"));
            } else if ("iswrites".equals(name)) {
                desc = "iswirte";
                hashtable.put("iswrites", tablesVO.get("value"));
            } else if ("isrewrites".equals(name)) {
                desc = "isrewrite";
                hashtable.put("isrewrites", tablesVO.get("value"));
            } else if ("isdeletes".equals(name)) {
                desc = "isdelete";
                hashtable.put("isdeletes", tablesVO.get("value"));
            } else if ("iscommits".equals(name)) {
                desc = "iscommit";
                hashtable.put("iscommits", tablesVO.get("value"));
            } else if ("isrollbacks".equals(name)) {
                desc = "isrollback";
                hashtable.put("isrollbacks", tablesVO.get("value"));
            } else if ("ovlock".equals(name)) {
                desc = "";
                hashtable.put("ovlock", tablesVO.get("value"));
            } else if ("ovuser".equals(name)) {
                desc = "";
                hashtable.put("ovuser", tablesVO.get("value"));
            } else if ("ovtrans".equals(name)) {
                desc = "";
                hashtable.put("ovtrans", tablesVO.get("value"));
            } else if ("latchwts".equals(name)) {
                desc = "";
                hashtable.put("latchwts", tablesVO.get("value"));
            } else if ("buffwts".equals(name)) {
                desc = "";
                hashtable.put("buffwts", tablesVO.get("value"));
            } else if ("lockreqs".equals(name)) {
                desc = "";
                hashtable.put("lockreqs", tablesVO.get("value"));
            } else if ("lockwts".equals(name)) {
                desc = "";
                hashtable.put("lockwts", tablesVO.get("value"));
            } else if ("ckptwts".equals(name)) {
                desc = "";
                hashtable.put("ckptwts", tablesVO.get("value"));
            } else if ("deadlks".equals(name)) {
                desc = "";
                hashtable.put("deadlks", tablesVO.get("value"));
            } else if ("lktouts".equals(name)) {
                desc = "";
                hashtable.put("lktouts", tablesVO.get("value"));
            } else if ("numckpts".equals(name)) {
                desc = "";
                hashtable.put("numckpts", tablesVO.get("value"));
            } else if ("plgpagewrites".equals(name)) {
                desc = "";
                hashtable.put("plgpagewrites", tablesVO.get("value"));
            } else if ("plgwrites".equals(name)) {
                desc = "";
                hashtable.put("plgwrites", tablesVO.get("value"));
            } else if ("llgrecs".equals(name)) {
                desc = "";
                hashtable.put("llgrecs", tablesVO.get("value"));
            } else if ("llgpagewrites".equals(name)) {
                desc = "";
                hashtable.put("llgpagewrites", tablesVO.get("value"));
            } else if ("llgwrites".equals(name)) {
                desc = "";
                hashtable.put("llgwrites", tablesVO.get("value"));
            } else if ("pagreads".equals(name)) {
                desc = "";
                hashtable.put("pagreads", tablesVO.get("value"));
            } else if ("pagwrites".equals(name)) {
                desc = "";
                hashtable.put("pagwrites", tablesVO.get("value"));
            } else if ("flushes".equals(name)) {
                desc = "";
                hashtable.put("flushes", tablesVO.get("value"));
            } else if ("compress".equals(name)) {
                desc = "";
                hashtable.put("compress", tablesVO.get("value"));
            } else if ("fgwrites".equals(name)) {
                desc = "";
                hashtable.put("fgwrites", tablesVO.get("value"));
            } else if ("lruwrites".equals(name)) {
                desc = "LRU";
                hashtable.put("lruwrites", tablesVO.get("value"));
            } else if ("chunkwrites".equals(name)) {
                desc = "";
                hashtable.put("chunkwrites", tablesVO.get("value"));
            } else if ("btradata".equals(name)) {
                desc = "";
                hashtable.put("btradata", tablesVO.get("value"));
            } else if ("btraidx".equals(name)) {
                desc = "";
                hashtable.put("btraidx", tablesVO.get("value"));
            } else if ("dpra".equals(name)) {
                desc = "";
                hashtable.put("dpra", tablesVO.get("value"));
            } else if ("rapgs_used".equals(name)) {
                desc = "";
                hashtable.put("rapgs_used", tablesVO.get("value"));
            } else if ("seqscans".equals(name)) {
                desc = "";
                hashtable.put("seqscans", tablesVO.get("value"));
            } else if ("totalsorts".equals(name)) {
                desc = "";
                hashtable.put("totalsorts", tablesVO.get("value"));
            } else if ("memsorts".equals(name)) {
                desc = "";
                hashtable.put("memsorts", tablesVO.get("value"));
            } else if ("disksorts".equals(name)) {
                desc = "";
                hashtable.put("disksorts", tablesVO.get("value"));
            } else if ("maxsortspace".equals(name)) {
                desc = "";
                hashtable.put("maxsortspace", tablesVO.get("value"));
            }
        }
    }

    cell = new Cell(new Phrase("IO", titleFont));
    cell.setRowspan(4);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("dskreads"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("bufreads"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("dskwrites"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("bufwrites"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("(/)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(/)", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("(/)", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("(/)", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setRowspan(5);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isamtot"), contextFont1));
    cell.setColspan(5);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("isopen", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isopens"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("isstart", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isstarts"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("isread", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isreads"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("iswirte", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("iswrites"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("isrewrite", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isrewrites"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("isdelete", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isdeletes"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("iscommit", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("iscommits"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("isrollback", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("isrollbacks"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setRowspan(4);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("latchwts"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("buffwts"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("lockreqs"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("lockwts"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("ckptwts"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("deadlks"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("lktouts"), contextFont1));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase((String) hashtable.get("numckpts"), contextFont1));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setRowspan(list.size() + 1);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    cell = new Cell(new Phrase("", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("MB", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("MB", titleFont));
    cell.setColspan(2);
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);
    cell = new Cell(new Phrase("%", titleFont));
    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
    aTable.addCell(cell);

    // get dbspace message==================

    int row = 0;
    DecimalFormat df = new DecimalFormat("#.###");
    if (dbspaces != null && dbspaces.size() > 0) {
        for (int i = 0; i < dbspaces.size(); i++) {
            Hashtable tablesVO = (Hashtable) dbspaces.get(i);
            double all = 100.00;
            double show = all - Double.parseDouble(tablesVO.get("percent_free").toString());
            String str = df.format(show) + "";
            String spacenameString = (String) tablesVO.get("dbspace");

            for (int j = 0; j < list.size(); j++) {
                Informixspaceconfig vo = (Informixspaceconfig) list.get(j);

                DBDao dbdao = new DBDao();
                // dbdao = new DBDao();
                List shareList = null;
                try {
                    shareList = dbdao.getDbByTypeAndIpaddress(typevo.getId(), vo.getIpaddress());
                } catch (Exception e) {
                } finally {
                    dbdao.close();
                }
                if (shareList == null || shareList.size() == 0)
                    continue;
                DBVo dbvo = (DBVo) shareList.get(0);

                if (spacenameString.equals(vo.getSpacename())) {
                    cell = new Cell(new Phrase(spacenameString, contextFont1));
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
                    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
                    aTable.addCell(cell);
                    cell = new Cell(new Phrase((String) tablesVO.get("pages_size"), contextFont1));
                    cell.setColspan(2);
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
                    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
                    aTable.addCell(cell);
                    cell = new Cell(new Phrase(df.format(Float.parseFloat(tablesVO.get("pages_used") + "")),
                            contextFont1));
                    cell.setColspan(2);
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
                    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
                    aTable.addCell(cell);
                    cell = new Cell(new Phrase(str, contextFont1));
                    cell.setHorizontalAlignment(Element.ALIGN_CENTER); // 
                    cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // 
                    aTable.addCell(cell);
                }

            }

        }
    }
    String count = (String) reportHash.get("count");
    cell = new Cell(new Phrase("" + "\n" + "" + "\n" + "" + "\n" + "", titleFont));
    cell.setRowspan(2);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + downnum + "" + "\n", contextFont1));
    cell.setColspan(7);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + count + "" + "\n", contextFont1));
    cell.setColspan(7);
    aTable.addCell(cell);
    cell = new Cell(new Phrase("\n" + "" + "\n", titleFont));
    cell.setColspan(8);
    this.setCellFormat(cell, true);
    aTable.addCell(cell);

    String pinglog = "";
    if ("0".equals(downnum)) {
        pinglog = "   " + "2    ";
    } else {
        pinglog = "   " + "2    " + downnum + "";
    }
    String spacelog = "";
    if ("0".equals(count)) {
        spacelog = "   " + "3    " + count
                + "" + "    ";
    } else {
        spacelog = "   " + "3    ";
    }
    cell = new Cell(new Phrase("   1      " + "\n" + "\n" + pinglog + "\n"
            + "\n" + spacelog + "\n" + "\n" + "\n" + "\n" + "\n" + "\n", contextFont1));
    cell.setColspan(8);
    aTable.addCell(cell);
    document.add(aTable);
    document.close();

}

From source file:include.nseer_cookie.printPDF.java

License:Open Source License

public Document print_type_across(String print_type, int print_left, int print_right, int print_top,
        int print_bottom) {

    try {/* www.jav  a2  s. com*/

        if (print_type.equals("A0"))
            document = new Document(PageSize.A0.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A1"))
            document = new Document(PageSize.A1.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A2"))
            document = new Document(PageSize.A2.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A3"))
            document = new Document(PageSize.A3.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A4"))
            document = new Document(PageSize.A4.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A5"))
            document = new Document(PageSize.A5.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A6"))
            document = new Document(PageSize.A6.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A7"))
            document = new Document(PageSize.A7.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A8"))
            document = new Document(PageSize.A8.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A9"))
            document = new Document(PageSize.A9.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B0"))
            document = new Document(PageSize.B0.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B1"))
            document = new Document(PageSize.B1.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B2"))
            document = new Document(PageSize.B2.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B3"))
            document = new Document(PageSize.B3.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B4"))
            document = new Document(PageSize.B4.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B5"))
            document = new Document(PageSize.B5.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_A"))
            document = new Document(PageSize.ARCH_A.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_B"))
            document = new Document(PageSize.ARCH_B.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_C"))
            document = new Document(PageSize.ARCH_C.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_D"))
            document = new Document(PageSize.ARCH_D.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_E"))
            document = new Document(PageSize.ARCH_E.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("FLSA"))
            document = new Document(PageSize.FLSA.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("FLSE"))
            document = new Document(PageSize.FLSE.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("NOTE"))
            document = new Document(PageSize.NOTE.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("_11X17"))
            document = new Document(PageSize._11X17.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("LETTER"))
            document = new Document(PageSize.LETTER.rotate(), print_left, print_right, print_top, print_bottom);
        if (print_type.equals("HALFLETTER"))
            document = new Document(PageSize.HALFLETTER.rotate(), print_left, print_right, print_top,
                    print_bottom);
        if (print_type.equals("LEDGER"))
            document = new Document(PageSize.LEDGER.rotate(), print_left, print_right, print_top, print_bottom);

    } catch (Exception e) {
        e.printStackTrace();
    }
    return document;
}

From source file:include.nseer_cookie.printPDF.java

License:Open Source License

public Document print_type_vertical(String print_type, int print_left, int print_right, int print_top,
        int print_bottom) {

    try {/*from   ww  w . ja  v a 2  s.co  m*/
        if (print_type.equals("A0"))
            document = new Document(PageSize.A0, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A1"))
            document = new Document(PageSize.A1, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A2"))
            document = new Document(PageSize.A2, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A3"))
            document = new Document(PageSize.A3, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A4"))
            document = new Document(PageSize.A4, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A5"))
            document = new Document(PageSize.A5, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A6"))
            document = new Document(PageSize.A6, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A7"))
            document = new Document(PageSize.A7, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A8"))
            document = new Document(PageSize.A8, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("A9"))
            document = new Document(PageSize.A9, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B0"))
            document = new Document(PageSize.B0, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B1"))
            document = new Document(PageSize.B1, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B2"))
            document = new Document(PageSize.B2, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B3"))
            document = new Document(PageSize.B3, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B4"))
            document = new Document(PageSize.B4, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("B5"))
            document = new Document(PageSize.B5, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_A"))
            document = new Document(PageSize.ARCH_A, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_B"))
            document = new Document(PageSize.ARCH_B, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_C"))
            document = new Document(PageSize.ARCH_C, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_D"))
            document = new Document(PageSize.ARCH_D, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("ARCH_E"))
            document = new Document(PageSize.ARCH_E, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("FLSA"))
            document = new Document(PageSize.FLSA, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("FLSE"))
            document = new Document(PageSize.FLSE, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("NOTE"))
            document = new Document(PageSize.NOTE, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("_11X17"))
            document = new Document(PageSize._11X17, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("LETTER"))
            document = new Document(PageSize.LETTER, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("HALFLETTER"))
            document = new Document(PageSize.HALFLETTER, print_left, print_right, print_top, print_bottom);
        if (print_type.equals("LEDGER"))
            document = new Document(PageSize.LEDGER, print_left, print_right, print_top, print_bottom);

    } catch (Exception e) {
        e.printStackTrace();
    }
    return document;
}