List of usage examples for com.lowagie.text Paragraph setFirstLineIndent
public void setFirstLineIndent(float firstLineIndent)
From source file:com.afunms.report.abstraction.ExcelReport1.java
/** * @author HONGLI MySQL pdf/*from w w w. j a v a 2 s. c o m*/ * @param filename * @throws DocumentException * @throws IOException */ public void createReportMySQLSelfPdf(String filename) throws DocumentException, IOException { if (impReport.getTable() == null) { fileName = null; return; } try { // Document document = new Document(PageSize.A4); // (Writer)document(Writer) PdfWriter.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 contextFont = new Font(bfChinese, 12, Font.NORMAL); String hostname = (String) reportHash.get("dbname"); String ip = (String) reportHash.get("ip"); String newip = doip(ip); Paragraph title = new Paragraph(hostname + "", titleFont); // title.setAlignment(Element.ALIGN_CENTER); // title.setFont(titleFont); document.add(title); String Ping = (String) reportHash.get("Ping"); String starttime = (String) reportHash.get("starttime"); String totime = (String) reportHash.get("totime"); Vector val = (Vector) reportHash.get("Val"); Hashtable maxping = (Hashtable) reportHash.get("ping"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String contextString = ":" + impReport.getTimeStamp() + " \n"// + ":" + starttime + " " + totime; Paragraph context = new Paragraph(contextString, contextFont); // context.setAlignment(Element.ALIGN_LEFT); // context.setFont(contextFont); // context.setSpacingBefore(5); // context.setFirstLineIndent(5); document.add(context); document.add(new Paragraph("\n")); /* * tmpLabel = new Label(0, 1, ":" + impReport.getTimeStamp()); * sheet.addCell(tmpLabel); tmpLabel = new Label(0, 2, ": " + * starttime + " " + totime); */ PdfPTable aTable = new PdfPTable(3); float[] widths = { 220f, 220f, 220f }; aTable.setWidths(widths); aTable.setWidthPercentage(100); PdfPCell cell = null; cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase((String) maxping.get("pingnow"))); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase((String) maxping.get("pingmax"))); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase((String) maxping.get("avgpingcon"))); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); Image img = Image.getInstance(ResourceCenter.getInstance().getSysPath() + "/resource/image/jfreechart/" + newip + "ConnectUtilization" + ".png"); img.setAlignment(Image.LEFT);// // document.add(aTable); img.scalePercent(76); document.add(aTable); document.add(img); document.add(new Paragraph("\n")); PdfPTable aTable1 = new PdfPTable(2); float[] width = { 220f, 220f }; aTable1.setWidths(width); aTable1.setWidthPercentage(100); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable1.addCell(cell); if (val != null && val.size() > 0) { for (int i = 0; i < val.size(); i++) { Hashtable return_value = (Hashtable) val.get(i); if (return_value != null && return_value.size() > 0) { String name = return_value.get("variable_name").toString(); String value = return_value.get("value").toString(); if (name.equalsIgnoreCase("Max_used_connections")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_first")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_key")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_next")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_prev")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_rnd")) { name = "H"; } if (name.equalsIgnoreCase("Handler_read_rnd_next")) { name = ""; } if (name.equalsIgnoreCase("Open_tables")) { name = ""; } if (name.equalsIgnoreCase("Opened_tables")) { name = ""; } if (name.equalsIgnoreCase("Threads_cached")) { name = ""; } if (name.equalsIgnoreCase("Threads_connected")) { name = ""; } if (name.equalsIgnoreCase("Threads_created")) { name = ""; } if (name.equalsIgnoreCase("Threads_running")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_immediate")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_waited")) { name = ""; } if (name.equalsIgnoreCase("Key_read_requests")) { name = ""; } if (name.equalsIgnoreCase("Key_reads")) { name = ""; } if (name.equalsIgnoreCase("log_slow_queries")) { name = ""; } if (name.equalsIgnoreCase("slow_launch_time")) { name = "Slow_launch_threads"; } cell = new PdfPCell(new Phrase(name, titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable1.addCell(cell); cell = new PdfPCell(new Phrase(value)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable1.addCell(cell); // aTable1.endHeaders(); } } } if (impReport.getChart() != null) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ChartUtilities.writeChartAsPNG(baos, impReport.getChart().getChart(), impReport.getChart().getWidth(), impReport.getChart().getHeight()); } catch (IOException ioe) { } Image img1 = Image.getInstance(baos.toByteArray()); img1.setAbsolutePosition(0, 0); img1.setAlignment(Image.MIDDLE);// document.add(img1); } document.add(aTable1); document.close(); } catch (Exception e) { // TODO: handle exception } }
From source file:com.afunms.report.abstraction.ExcelReport1.java
/** * @author HONGLI MySQLword,pdf/*www. ja v a2s. c o m*/ * @param filename * @param type * @throws IOException */ public void createReport_MySQLCldDoc(String filename, String type) throws IOException { if (impReport.getTable() == null) { fileName = null; return; } try { // Document document = new Document(PageSize.A4); // (Writer)document(Writer) if ("pdf".equals(type)) { PdfWriter.getInstance(document, new FileOutputStream(filename)); } else { 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 contextFont = new Font(bfChinese, 12, Font.NORMAL); String hostname = (String) reportHash.get("dbname"); String ip = (String) reportHash.get("ip"); String typename = (String) reportHash.get("typename"); String runstr = (String) reportHash.get("runstr"); String grade = (String) reportHash.get("grade"); String pingnow = (String) reportHash.get("pingnow"); String pingmin = (String) reportHash.get("pingmin"); String pingconavg = (String) reportHash.get("pingconavg"); DBVo vo = (DBVo) reportHash.get("vo"); Vector val = (Vector) reportHash.get("Val"); if (val == null) { val = new Vector(); } List sessionlist = (ArrayList) reportHash.get("sessionlist"); if (sessionlist == null) { sessionlist = new ArrayList(); } Hashtable tablesHash = (Hashtable) reportHash.get("tablesHash"); if (tablesHash == null) { tablesHash = new Hashtable(); } Vector tableinfo_v = (Vector) reportHash.get("tableinfo_v"); if (tableinfo_v == null) { tableinfo_v = new Vector(); } String newip = doip(ip); Paragraph title = new Paragraph(hostname + "", titleFont); // title.setAlignment(Element.ALIGN_CENTER); // title.setFont(titleFont); document.add(title); String Ping = (String) reportHash.get("Ping"); String starttime = (String) reportHash.get("starttime"); String totime = (String) reportHash.get("totime"); Hashtable maxping = (Hashtable) reportHash.get("ping"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String contextString = ":" + impReport.getTimeStamp() + " \n"// + ":" + starttime + " " + totime; Paragraph context = new Paragraph(contextString, contextFont); // context.setAlignment(Element.ALIGN_LEFT); // context.setFont(contextFont); // context.setSpacingBefore(5); // context.setFirstLineIndent(5); document.add(context); /* * tmpLabel = new Label(0, 1, ":" + impReport.getTimeStamp()); * sheet.addCell(tmpLabel); tmpLabel = new Label(0, 2, ": " + * starttime + " " + totime); */ // Table dbTable = new Table(5); this.setTableFormat(dbTable); // float[] cellWidths = { 220f, 220f, 220f, 220f, 220f }; // dbTable.setWidths(cellWidths); // dbTable.setWidth(100); // 90% // dbTable.setAlignment(Element.ALIGN_CENTER);// // dbTable.setAutoFillEmptyCells(true); // // dbTable.setBorderWidth(1); // // dbTable.setBorderColor(new Color(0, 125, 255)); // // dbTable.setPadding(2);// // dbTable.setSpacing(0);// // dbTable.setBorder(2);// // dbTable.endHeaders(); Cell dbCell = null; dbCell = new Cell(new Phrase("", titleFont)); this.setCellFormat(dbCell, true); dbCell.setColspan(5); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase("", titleFont)); this.setCellFormat(dbCell, true); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase("IP", titleFont)); this.setCellFormat(dbCell, true); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase("", titleFont)); this.setCellFormat(dbCell, true); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase("", titleFont)); this.setCellFormat(dbCell, true); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase("", titleFont)); this.setCellFormat(dbCell, true); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase(vo.getDbName(), contextFont)); this.setCellFormat(dbCell, false); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase(ip, contextFont)); this.setCellFormat(dbCell, false); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase(typename, contextFont)); this.setCellFormat(dbCell, false); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase(runstr, contextFont)); this.setCellFormat(dbCell, false); dbTable.addCell(dbCell); dbCell = new Cell(new Phrase(grade, contextFont)); this.setCellFormat(dbCell, false); dbTable.addCell(dbCell); Table aTable = new Table(3); this.setTableFormat(aTable); // float[] widths = { 220f, 220f, 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);// // aTable.endHeaders(); Cell cell = null; cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); aTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); aTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); aTable.addCell(cell); cell = new Cell(new Phrase(pingnow + "%", contextFont)); this.setCellFormat(cell, false); aTable.addCell(cell); cell = new Cell(new Phrase(pingmin + "%", contextFont)); this.setCellFormat(cell, false); aTable.addCell(cell); cell = new Cell(new Phrase(pingconavg + "%", contextFont)); this.setCellFormat(cell, false); aTable.addCell(cell); // Image img = Image.getInstance(ResourceCenter.getInstance().getSysPath() + "/resource/image/jfreechart/" + newip + "ConnectUtilization" + ".png"); // img.setAbsolutePosition(0, 0); img.scalePercent(76); img.setAlignment(Image.LEFT);// document.add(dbTable); document.add(aTable); document.add(img); document.add(new Paragraph("\n")); Table xnTable = new Table(2); this.setTableFormat(xnTable); // float[] width = { 220f, 220f }; // xnTable.setWidths(width); // xnTable.setWidth(100); // 90% // xnTable.setAlignment(Element.ALIGN_CENTER);// // xnTable.setAutoFillEmptyCells(true); // // xnTable.setBorderWidth(1); // // xnTable.setBorderColor(new Color(0, 125, 255)); // // xnTable.setPadding(2);// // xnTable.setSpacing(0);// // xnTable.setBorder(2);// cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); cell.setColspan(2); xnTable.addCell(cell); // if (val != null && val.size() > 0) { for (int i = 0; i < val.size(); i++) { Hashtable return_value = (Hashtable) val.get(i); if (return_value != null && return_value.size() > 0) { String name = return_value.get("variable_name").toString(); String value = return_value.get("value").toString(); if (name.equalsIgnoreCase("Max_used_connections")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_first")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_key")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_next")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_prev")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_rnd")) { name = "H"; } if (name.equalsIgnoreCase("Handler_read_rnd_next")) { name = ""; } if (name.equalsIgnoreCase("Open_tables")) { name = ""; } if (name.equalsIgnoreCase("Opened_tables")) { name = ""; } if (name.equalsIgnoreCase("Threads_cached")) { name = ""; } if (name.equalsIgnoreCase("Threads_connected")) { name = ""; } if (name.equalsIgnoreCase("Threads_created")) { name = ""; } if (name.equalsIgnoreCase("Threads_running")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_immediate")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_waited")) { name = ""; } if (name.equalsIgnoreCase("Key_read_requests")) { name = ""; } if (name.equalsIgnoreCase("Key_reads")) { name = ""; } if (name.equalsIgnoreCase("log_slow_queries")) { name = ""; } if (name.equalsIgnoreCase("slow_launch_time")) { name = "Slow_launch_threads"; } cell = new Cell(new Phrase(name, contextFont)); this.setCellFormat(cell, true); xnTable.addCell(cell); cell = new Cell(new Phrase(value, contextFont)); this.setCellFormat(cell, false); xnTable.addCell(cell); } } } document.add(xnTable); // Table dbInfoTable = new Table(6); this.setTableFormat(dbInfoTable); // float[] dbInfoWidths = { 220f, 220f, 220f, 220f, 220f, 220f }; // dbInfoTable.setWidths(dbInfoWidths); // dbInfoTable.setWidth(100); // 90% // dbInfoTable.setAlignment(Element.ALIGN_CENTER);// // dbInfoTable.setAutoFillEmptyCells(true); // // dbInfoTable.setBorderWidth(1); // // dbInfoTable.setBorderColor(new Color(0, 125, 255)); // // dbInfoTable.setPadding(2);// // dbInfoTable.setSpacing(0);// // dbInfoTable.setBorder(2);// cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); cell.setColspan(6); dbInfoTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); dbInfoTable.addCell(cell); if (sessionlist != null && sessionlist.size() > 0) { for (int i = 0; i < sessionlist.size(); i++) { List ipsessionlist = (List) sessionlist.get(i); if (ipsessionlist != null && ipsessionlist.size() > 0) { for (int k = 0; k < ipsessionlist.size(); k++) { String[] sessions = (String[]) ipsessionlist.get(k); if (sessions != null && sessions.length == 5) { cell = new Cell(new Phrase((k + 1) + "", contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(sessions[4], contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(sessions[0], contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(sessions[1], contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(sessions[2], contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); cell = new Cell(new Phrase(sessions[3], contextFont)); this.setCellFormat(cell, false); dbInfoTable.addCell(cell); } } } } } document.add(dbInfoTable); // Table tabTable = new Table(5); this.setTableFormat(tabTable); // float[] sysInfoWidths = { 220f, 220f, 220f, 220f, 220f }; // dbInfoTable.setWidths(dbInfoWidths); // tabTable.setWidth(100); // 90% // tabTable.setAlignment(Element.ALIGN_CENTER);// // tabTable.setAutoFillEmptyCells(true); // // tabTable.setBorderWidth(1); // // tabTable.setBorderColor(new Color(0, 125, 255)); // // tabTable.setPadding(2);// // tabTable.setSpacing(0);// // tabTable.setBorder(2);// Hashtable sysValue = (Hashtable) reportHash.get("sysValue");// cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); cell.setColspan(5); tabTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); tabTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); tabTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); tabTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); tabTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); tabTable.addCell(cell); String[] dbs = vo.getDbName().split(","); if (dbs != null && dbs.length > 0) { for (int i = 0; i < dbs.length; i++) { String dbStr = dbs[i]; // System.out.println(dbStr+"====="+tablesHash.size()); if (tablesHash.containsKey(dbStr)) { List tableslist = (List) tablesHash.get(dbStr); if (tableslist != null && tableslist.size() > 0) { for (int k = 0; k < tableslist.size(); k++) { String[] tables = (String[]) tableslist.get(k); if (tables != null && tables.length == 4) { cell = new Cell(new Phrase((k + 1) + "", contextFont)); this.setCellFormat(cell, false); tabTable.addCell(cell); cell = new Cell(new Phrase(tables[0], contextFont)); this.setCellFormat(cell, false); tabTable.addCell(cell); cell = new Cell(new Phrase(tables[1], contextFont)); this.setCellFormat(cell, false); tabTable.addCell(cell); cell = new Cell(new Phrase(tables[2], contextFont)); this.setCellFormat(cell, false); tabTable.addCell(cell); cell = new Cell(new Phrase(tables[3], contextFont)); this.setCellFormat(cell, false); tabTable.addCell(cell); } } } } } } document.add(tabTable); // Table stateTable = new Table(3); this.setTableFormat(stateTable); // float[] statewidth = { 220f, 220f, 220f }; // stateTable.setWidths(statewidth); // stateTable.setWidth(100); // 90% // stateTable.setAlignment(Element.ALIGN_CENTER);// // stateTable.setAutoFillEmptyCells(true); // // stateTable.setBorderWidth(1); // // stateTable.setBorderColor(new Color(0, 125, 255)); // // stateTable.setPadding(2);// // stateTable.setSpacing(0);// // stateTable.setBorder(2);// cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); cell.setColspan(3);// HONGLILI stateTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); stateTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); stateTable.addCell(cell); cell = new Cell(new Phrase(" ", titleFont)); this.setCellFormat(cell, true); stateTable.addCell(cell); if (tableinfo_v != null) { for (int i = 0; i < tableinfo_v.size(); i++) { Hashtable ht = (Hashtable) tableinfo_v.get(i); String size = ht.get("variable_name").toString(); String free = ht.get("value").toString(); if (size.equalsIgnoreCase("auto_increment_increment")) { size = ""; } if (size.equalsIgnoreCase("auto_increment_offset")) { size = "AUTO_INCREMENT"; } if (size.equalsIgnoreCase("automatic_sp_privileges")) { size = "automatic_sp_privileges"; } if (size.equalsIgnoreCase("back_log")) { size = ""; } if (size.equalsIgnoreCase("basedir")) { size = "MySQL"; } if (size.equalsIgnoreCase("binlog_cache_size")) { size = "SQL"; } if (size.equalsIgnoreCase("bulk_insert_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("character_set_client")) { size = ""; } if (size.equalsIgnoreCase("character_set_connection")) { size = ""; } if (size.equalsIgnoreCase("character_set_database")) { size = ""; } if (size.equalsIgnoreCase("character_set_filesystem")) { size = "character_set_filesystem"; } if (size.equalsIgnoreCase("character_set_results")) { size = ""; } if (size.equalsIgnoreCase("character_set_server")) { size = ""; } if (size.equalsIgnoreCase("character_set_system")) { size = ""; } if (size.equalsIgnoreCase("character_sets_dir")) { size = ""; } if (size.equalsIgnoreCase("collation_connection")) { size = ""; } if (size.equalsIgnoreCase("collation_database")) { size = ""; } if (size.equalsIgnoreCase("collation_server")) { size = ""; } if (size.equalsIgnoreCase("completion_type")) { size = ""; } if (size.equalsIgnoreCase("concurrent_insert")) { size = ""; } if (size.equalsIgnoreCase("connect_timeout")) { size = "Bad handshake"; } if (size.equalsIgnoreCase("datadir")) { size = "MySQL"; } if (size.equalsIgnoreCase("date_format")) { size = "date_format()"; } if (size.equalsIgnoreCase("datetime_format")) { size = "datetime_format()"; } if (size.equalsIgnoreCase("default_week_format")) { size = "WEEK() "; } if (size.equalsIgnoreCase("delay_key_write")) { size = "DELAY_KEY_WRITE"; } if (size.equalsIgnoreCase("delayed_insert_limit")) { size = "INSERT DELAYEDSELECT"; } if (size.equalsIgnoreCase("delayed_insert_timeout")) { size = "INSERT DELAYEDINSERT"; } if (size.equalsIgnoreCase("delayed_queue_size")) { size = "INSERT DELAYED"; } if (size.equalsIgnoreCase("div_precision_increment")) { size = "/"; } if (size.equalsIgnoreCase("engine_condition_pushdown")) { size = "NDB"; } if (size.equalsIgnoreCase("expire_logs_days")) { size = ""; } if (size.equalsIgnoreCase("flush")) { size = "flushmysqld"; } if (size.equalsIgnoreCase("flush_time")) { size = ""; } if (size.equalsIgnoreCase("ft_boolean_syntax")) { size = "IN BOOLEAN MODE"; } if (size.equalsIgnoreCase("ft_max_word_len")) { size = "FULLTEXT"; } if (size.equalsIgnoreCase("ft_min_word_len")) { size = "FULLTEXT"; } if (size.equalsIgnoreCase("ft_query_expansion_limit")) { size = "WITH QUERY EXPANSION"; } if (size.equalsIgnoreCase("ft_stopword_file")) { size = ""; } if (size.equalsIgnoreCase("group_concat_max_len")) { size = "GROUP_CONCAT()"; } if (size.equalsIgnoreCase("have_archive")) { size = "mysqldARCHIVE"; } if (size.equalsIgnoreCase("have_bdb")) { size = "mysqldBDB"; } if (size.equalsIgnoreCase("have_blackhole_engine")) { size = "mysqldBLACKHOLE"; } if (size.equalsIgnoreCase("have_compress")) { size = "zlib"; } if (size.equalsIgnoreCase("have_crypt")) { size = "crypt()"; } if (size.equalsIgnoreCase("have_csv")) { size = "mysqldARCHIVE"; } if (size.equalsIgnoreCase("have_example_engine")) { size = "mysqldEXAMPLE"; } if (size.equalsIgnoreCase("have_federated_engine")) { size = "mysqldFEDERATED"; } if (size.equalsIgnoreCase("have_geometry")) { size = ""; } if (size.equalsIgnoreCase("have_innodb")) { size = "mysqldInnoDB"; } if (size.equalsIgnoreCase("have_isam")) { size = ""; } if (size.equalsIgnoreCase("have_ndbcluster")) { size = "mysqldNDB CLUSTER"; } if (size.equalsIgnoreCase("have_openssl")) { size = "mysqld/SSL()"; } if (size.equalsIgnoreCase("have_query_cache")) { size = "mysqld"; } if (size.equalsIgnoreCase("have_raid")) { size = "mysqldRAID"; } if (size.equalsIgnoreCase("have_rtree_keys")) { size = "RTREE"; } if (size.equalsIgnoreCase("have_symlink")) { size = ""; } if (size.equalsIgnoreCase("init_connect")) { size = ""; } if (size.equalsIgnoreCase("init_file")) { size = "--init-file"; } if (size.equalsIgnoreCase("init_slave")) { size = "SQL"; } if (size.equalsIgnoreCase("innodb_additional_mem_pool_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_autoextend_increment")) { size = ""; } if (size.equalsIgnoreCase("innodb_buffer_pool_awe_mem_mb")) { size = "32WindowsAWE"; } if (size.equalsIgnoreCase("innodb_buffer_pool_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_checksums")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_commit_concurrency")) { size = "innodb_commit_concurrency"; } if (size.equalsIgnoreCase("innodb_concurrency_tickets")) { size = "innodb_concurrency_tickets"; } if (size.equalsIgnoreCase("innodb_data_file_path")) { size = ""; } if (size.equalsIgnoreCase("innodb_data_home_dir")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_doublewrite")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_fast_shutdown")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_file_io_threads")) { size = "InnoDBI/O"; } if (size.equalsIgnoreCase("innodb_file_per_table")) { size = "InnoDB.ibd"; } if (size.equalsIgnoreCase("innodb_flush_log_at_trx_commit")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_flush_method")) { size = "InnoDBfsync()"; } if (size.equalsIgnoreCase("innodb_force_recovery")) { size = ""; } if (size.equalsIgnoreCase("innodb_lock_wait_timeout")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_locks_unsafe_for_binlog")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_log_arch_dir")) { size = " "; } if (size.equalsIgnoreCase("innodb_log_archive")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_buffer_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_log_file_size")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_files_in_group")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_group_home_dir")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_max_dirty_pages_pct")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_max_purge_lag")) { size = "INSERT,UPDATEDELETE"; } if (size.equalsIgnoreCase("innodb_mirrored_log_groups")) { size = ""; } if (size.equalsIgnoreCase("innodb_open_files")) { size = "InnoDB.ibd"; } if (size.equalsIgnoreCase("innodb_support_xa")) { size = "InnoDBXA"; } if (size.equalsIgnoreCase("innodb_sync_spin_loops")) { size = "innodb_sync_spin_loops"; } if (size.equalsIgnoreCase("innodb_table_locks")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_thread_concurrency")) { size = "InnoDBInnoDB"; } if (size.equalsIgnoreCase("innodb_thread_sleep_delay")) { size = "InnoDBSHOW INNODB STATUS<datadir>/innodb_status"; } if (size.equalsIgnoreCase("interactive_timeout")) { size = ""; } if (size.equalsIgnoreCase("join_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("key_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("key_cache_age_threshold")) { size = "(sub-chain)(sub-chain)"; } if (size.equalsIgnoreCase("key_cache_block_size")) { size = ""; } if (size.equalsIgnoreCase("key_cache_division_limit")) { size = ""; } if (size.equalsIgnoreCase("language")) { size = ""; } if (size.equalsIgnoreCase("large_files_support")) { size = "mysqld"; } if (size.equalsIgnoreCase("large_page_size")) { size = "large_page_size"; } if (size.equalsIgnoreCase("large_pages")) { size = ""; } if (size.equalsIgnoreCase("license")) { size = ""; } if (size.equalsIgnoreCase("local_infile")) { size = "LOCALLOAD DATA INFILE"; } if (size.equalsIgnoreCase("log")) { size = ""; } if (size.equalsIgnoreCase("log_bin")) { size = ""; } if (size.equalsIgnoreCase("log_bin_trust_function_creators")) { size = ""; } if (size.equalsIgnoreCase("log_error")) { size = ""; } if (size.equalsIgnoreCase("log_slave_updates")) { size = ""; } if (size.equalsIgnoreCase("log_slow_queries")) { size = ""; } if (size.equalsIgnoreCase("log_warnings")) { size = ""; } if (size.equalsIgnoreCase("long_query_time")) { size = "Slow_queries"; } if (size.equalsIgnoreCase("low_priority_updates")) { size = "sqlSELECTLOCK TABLE READ"; } if (size.equalsIgnoreCase("lower_case_file_system")) { size = ""; } if (size.equalsIgnoreCase("lower_case_table_names")) { size = "1"; } if (size.equalsIgnoreCase("max_allowed_packet")) { size = "/"; } if (size.equalsIgnoreCase("max_binlog_cache_size")) { size = ""; } if (size.equalsIgnoreCase("max_binlog_size")) { size = ""; } if (size.equalsIgnoreCase("max_connect_errors")) { size = ""; } if (size.equalsIgnoreCase("max_connections")) { size = ""; } if (size.equalsIgnoreCase("max_delayed_threads")) { size = "INSERT DELAYED"; } if (size.equalsIgnoreCase("max_error_count")) { size = "SHOW ERRORSSHOW WARNINGS"; } if (size.equalsIgnoreCase("max_heap_table_size")) { size = "MEMORY (HEAP)"; } if (size.equalsIgnoreCase("max_insert_delayed_threads")) { size = "INSERT DELAYED(max_delayed_threads)"; } if (size.equalsIgnoreCase("max_join_size")) { size = "max_join_size"; } if (size.equalsIgnoreCase("max_length_for_sort_data")) { size = "filesort"; } if (size.equalsIgnoreCase("max_prepared_stmt_count")) { size = "max_prepared_stmt_count"; } if (size.equalsIgnoreCase("max_relay_log_size")) { size = ""; } if (size.equalsIgnoreCase("max_seeks_for_key")) { size = ""; } if (size.equalsIgnoreCase("max_sort_length")) { size = "BLOBTEXT"; } if (size.equalsIgnoreCase("max_sp_recursion_depth")) { size = "max_sp_recursion_depth"; } if (size.equalsIgnoreCase("max_tmp_tables")) { size = ""; } if (size.equalsIgnoreCase("max_user_connections")) { size = "MySQL"; } if (size.equalsIgnoreCase("max_write_lock_count")) { size = ""; } if (size.equalsIgnoreCase("multi_range_count")) { size = "multi_range_count"; } if (size.equalsIgnoreCase("myisam_data_pointer_size")) { size = ""; } if (size.equalsIgnoreCase("myisam_max_sort_file_size")) { size = "MyISAMMySQL"; } if (size.equalsIgnoreCase("myisam_recover_options")) { size = "myisam-recover"; } if (size.equalsIgnoreCase("myisam_repair_threads")) { size = "1Repair by sortingMyISAM"; } if (size.equalsIgnoreCase("myisam_sort_buffer_size")) { size = "REPAIR TABLECREATE INDEXALTER TABLEMyISAM"; } if (size.equalsIgnoreCase("myisam_stats_method")) { size = "MyISAMNULL"; } if (size.equalsIgnoreCase("named_pipe")) { size = ""; } if (size.equalsIgnoreCase("net_buffer_length")) { size = ""; } if (size.equalsIgnoreCase("net_read_timeout")) { size = ""; } if (size.equalsIgnoreCase("net_retry_count")) { size = ""; } if (size.equalsIgnoreCase("net_write_timeout")) { size = ""; } if (size.equalsIgnoreCase("new")) { size = "MySQL 4.04.1"; } if (size.equalsIgnoreCase("old_passwords")) { size = "MySQLpre-4.1-style"; } if (size.equalsIgnoreCase("open_files_limit")) { size = "mysqld"; } if (size.equalsIgnoreCase("optimizer_prune_level")) { size = " 0"; } if (size.equalsIgnoreCase("optimizer_search_depth")) { size = ""; } if (size.equalsIgnoreCase("pid_file")) { size = "ID (PID)"; } if (size.equalsIgnoreCase("prepared_stmt_count")) { size = "prepared_stmt_count"; } if (size.equalsIgnoreCase("port")) { size = "TCP/IP"; } if (size.equalsIgnoreCase("preload_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("protocol_version")) { size = "MySQL/"; } if (size.equalsIgnoreCase("query_alloc_block_size")) { size = ""; } if (size.equalsIgnoreCase("query_cache_limit")) { size = ""; } if (size.equalsIgnoreCase("query_cache_min_res_unit")) { size = "()"; } if (size.equalsIgnoreCase("query_cache_size")) { size = ""; } if (size.equalsIgnoreCase("query_cache_type")) { size = ""; } if (size.equalsIgnoreCase("query_cache_wlock_invalidate")) { size = "WRITE"; } if (size.equalsIgnoreCase("query_prealloc_size")) { size = ""; } if (size.equalsIgnoreCase("range_alloc_block_size")) { size = ""; } if (size.equalsIgnoreCase("read_buffer_size")) { size = "()"; } if (size.equalsIgnoreCase("read_only")) { size = "ON"; } if (size.equalsIgnoreCase("read_only")) { size = "ON"; } if (size.equalsIgnoreCase("relay_log_purge")) { size = ""; } if (size.equalsIgnoreCase("read_rnd_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("secure_auth")) { size = "--secure-authMySQL(4.1)"; } if (size.equalsIgnoreCase("shared_memory")) { size = "(Windows)"; } if (size.equalsIgnoreCase("shared_memory_base_name")) { size = "(Windows)"; } if (size.equalsIgnoreCase("server_id")) { size = ""; } if (size.equalsIgnoreCase("skip_external_locking")) { size = "mysqld"; } if (size.equalsIgnoreCase("skip_networking")) { size = "(TCP/IP)"; } if (size.equalsIgnoreCase("skip_show_database")) { size = "SHOW DATABASESSHOW DATABASES"; } if (size.equalsIgnoreCase("slave_compressed_protocol")) { size = "/"; } if (size.equalsIgnoreCase("slave_load_tmpdir")) { size = "LOAD DATA INFILE"; } if (size.equalsIgnoreCase("slave_net_timeout")) { size = "/"; } if (size.equalsIgnoreCase("slave_skip_errors")) { size = "()"; } if (size.equalsIgnoreCase("slave_transaction_retries")) { size = "SQLslave_transaction_retries"; } if (size.equalsIgnoreCase("slow_launch_time")) { size = "Slow_launch_threads"; } if (size.equalsIgnoreCase("sort_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("sql_mode")) { size = "SQL"; } if (size.equalsIgnoreCase("storage_engine")) { size = "table_typeisMySQL 5.1,storage_engine"; } if (size.equalsIgnoreCase("sync_binlog")) { size = "sync_binlog'thMySQL"; } if (size.equalsIgnoreCase("sync_frm")) { size = "1,.frm"; } if (size.equalsIgnoreCase("system_time_zone")) { size = ""; } if (size.equalsIgnoreCase("table_cache")) { size = ""; } if (size.equalsIgnoreCase("table_type")) { size = "()"; } if (size.equalsIgnoreCase("thread_cache_size")) { size = ""; } if (size.equalsIgnoreCase("thread_stack")) { size = ""; } if (size.equalsIgnoreCase("time_format")) { size = ""; } if (size.equalsIgnoreCase("time_zone")) { size = ""; } if (size.equalsIgnoreCase("tmp_table_size")) { size = "MySQLMyISAM"; } if (size.equalsIgnoreCase("tmpdir")) { size = ""; } if (size.equalsIgnoreCase("transaction_alloc_block_size")) { size = "()"; } if (size.equalsIgnoreCase("transaction_prealloc_size")) { size = "transaction_alloc_blocks"; } if (size.equalsIgnoreCase("tx_isolation")) { size = ""; } if (size.equalsIgnoreCase("updatable_views_with_limit")) { size = "LIMIT"; } if (size.equalsIgnoreCase("version")) { size = ""; } if (size.equalsIgnoreCase("version_bdb")) { size = "BDB"; } if (size.equalsIgnoreCase("version_comment")) { size = "configure--with-commentMySQL"; } if (size.equalsIgnoreCase("version_compile_machine")) { size = "MySQL"; } if (size.equalsIgnoreCase("version_compile_os")) { size = "MySQL"; } if (size.equalsIgnoreCase("wait_timeout")) { size = ""; } cell = new Cell(new Phrase(String.valueOf(i + 1), contextFont)); this.setCellFormat(cell, false); stateTable.addCell(cell); cell = new Cell(new Phrase(size, contextFont)); this.setCellFormat(cell, false); stateTable.addCell(cell); cell = new Cell(new Phrase(free, contextFont)); this.setCellFormat(cell, false); stateTable.addCell(cell); // stateTable.endHeaders(); } } // HONGLILI document.add(stateTable); // Table evenInfoTable = new Table(2); this.setTableFormat(evenInfoTable); // float[] evenInfoWidths = { 220f, 220f }; // evenInfoTable.setWidths(evenInfoWidths); // evenInfoTable.setWidth(100); // 90% // evenInfoTable.setAlignment(Element.ALIGN_CENTER);// // evenInfoTable.setAutoFillEmptyCells(true); // // evenInfoTable.setBorderWidth(1); // // evenInfoTable.setBorderColor(new Color(0, 125, 255)); // // evenInfoTable.setPadding(2);// // evenInfoTable.setSpacing(0);// // evenInfoTable.setBorder(2);// String downnum = (String) reportHash.get("downnum"); String count = (Integer) reportHash.get("count") + ""; cell = new Cell(new Phrase("", titleFont)); cell.setColspan(2); this.setCellFormat(cell, true); evenInfoTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); evenInfoTable.addCell(cell); cell = new Cell(new Phrase("", titleFont)); this.setCellFormat(cell, true); evenInfoTable.addCell(cell); cell = new Cell(new Phrase(downnum, contextFont)); this.setCellFormat(cell, false); evenInfoTable.addCell(cell); cell = new Cell(new Phrase(count, contextFont)); this.setCellFormat(cell, false); evenInfoTable.addCell(cell); document.add(evenInfoTable); // addEventListToDoc(document, titleFont, contextFont); document.close(); } catch (Exception e) { // SysLogger.error("Error in ExcelReport.createReport()",e); SysLogger.error("", e); } }
From source file:com.afunms.report.abstraction.ExcelReport1.java
/** * @author HONGLI MySQLpdf//from ww w .j ava 2 s. com * @param filename * @throws DocumentException * @throws IOException */ public void createReport_MySQLCldPdf(String filename) throws DocumentException, IOException { if (impReport.getTable() == null) { fileName = null; return; } try { // Document document = new Document(PageSize.A4); // (Writer)document(Writer) PdfWriter.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 contextFont = new Font(bfChinese, 12, Font.NORMAL); String hostname = (String) reportHash.get("dbname"); String ip = (String) reportHash.get("ip"); String typename = (String) reportHash.get("typename"); String runstr = (String) reportHash.get("runstr"); String grade = (String) reportHash.get("grade"); String pingnow = (String) reportHash.get("pingnow"); String pingmin = (String) reportHash.get("pingmin"); String pingconavg = (String) reportHash.get("pingconavg"); DBVo vo = (DBVo) reportHash.get("vo"); Vector val = (Vector) reportHash.get("Val"); if (val == null) { val = new Vector(); } List sessionlist = (ArrayList) reportHash.get("sessionlist"); if (sessionlist == null) { sessionlist = new ArrayList(); } Hashtable tablesHash = (Hashtable) reportHash.get("tablesHash"); if (tablesHash == null) { tablesHash = new Hashtable(); } Vector tableinfo_v = (Vector) reportHash.get("tableinfo_v"); if (tableinfo_v == null) { tableinfo_v = new Vector(); } String newip = doip(ip); Paragraph title = new Paragraph(hostname + "", titleFont); // title.setAlignment(Element.ALIGN_CENTER); // title.setFont(titleFont); document.add(title); String Ping = (String) reportHash.get("Ping"); String starttime = (String) reportHash.get("starttime"); String totime = (String) reportHash.get("totime"); Hashtable maxping = (Hashtable) reportHash.get("ping"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String contextString = ":" + impReport.getTimeStamp() + " \n"// + ":" + starttime + " " + totime; Paragraph context = new Paragraph(contextString, contextFont); // context.setAlignment(Element.ALIGN_LEFT); // context.setFont(contextFont); // context.setSpacingBefore(5); // context.setFirstLineIndent(5); document.add(context); document.add(new Paragraph("\n")); /* * tmpLabel = new Label(0, 1, ":" + impReport.getTimeStamp()); * sheet.addCell(tmpLabel); tmpLabel = new Label(0, 2, ": " + * starttime + " " + totime); */ // PdfPTable dbTable = new PdfPTable(5); float[] cellWidths = { 220f, 220f, 220f, 220f, 220f }; dbTable.setWidths(cellWidths); dbTable.setWidthPercentage(100); PdfPCell dbCell = null; dbCell = new PdfPCell(new Phrase("", titleFont)); dbCell.setColspan(5); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase("", titleFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase("IP", titleFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase("", titleFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase("", titleFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase("", titleFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase(vo.getDbName(), contextFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase(ip, contextFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase(typename, contextFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase(runstr, contextFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); dbCell = new PdfPCell(new Phrase(grade, contextFont)); dbCell.setHorizontalAlignment(Element.ALIGN_CENTER); // dbCell.setVerticalAlignment(Element.ALIGN_MIDDLE); // dbTable.addCell(dbCell); PdfPTable aTable = new PdfPTable(3); float[] widths = { 220f, 220f, 220f }; aTable.setWidths(widths); aTable.setWidthPercentage(100); PdfPCell cell = null; cell = new PdfPCell(new Phrase("", titleFont)); cell.setColspan(3); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase(pingnow + "%", contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase(pingmin + "%", contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); cell = new PdfPCell(new Phrase(pingconavg + "%", contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // aTable.addCell(cell); // Image img = Image.getInstance(ResourceCenter.getInstance().getSysPath() + "/resource/image/jfreechart/" + newip + "ConnectUtilization" + ".png"); // img.setAbsolutePosition(0, 0); img.scalePercent(76); img.setAlignment(Image.MIDDLE);// document.add(dbTable); document.add(new Paragraph("\n")); document.add(aTable); document.add(img); document.add(new Paragraph("\n")); // PdfPTable xnTable = new PdfPTable(2); float[] width = { 220f, 220f }; xnTable.setWidths(width); xnTable.setWidthPercentage(100); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // xnTable.addCell(cell); if (val != null && val.size() > 0) { for (int i = 0; i < val.size(); i++) { Hashtable return_value = (Hashtable) val.get(i); if (return_value != null && return_value.size() > 0) { String name = return_value.get("variable_name").toString(); String value = return_value.get("value").toString(); if (name.equalsIgnoreCase("Max_used_connections")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_first")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_key")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_next")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_prev")) { name = ""; } if (name.equalsIgnoreCase("Handler_read_rnd")) { name = "H"; } if (name.equalsIgnoreCase("Handler_read_rnd_next")) { name = ""; } if (name.equalsIgnoreCase("Open_tables")) { name = ""; } if (name.equalsIgnoreCase("Opened_tables")) { name = ""; } if (name.equalsIgnoreCase("Threads_cached")) { name = ""; } if (name.equalsIgnoreCase("Threads_connected")) { name = ""; } if (name.equalsIgnoreCase("Threads_created")) { name = ""; } if (name.equalsIgnoreCase("Threads_running")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_immediate")) { name = ""; } if (name.equalsIgnoreCase("Table_locks_waited")) { name = ""; } if (name.equalsIgnoreCase("Key_read_requests")) { name = ""; } if (name.equalsIgnoreCase("Key_reads")) { name = ""; } if (name.equalsIgnoreCase("log_slow_queries")) { name = ""; } if (name.equalsIgnoreCase("slow_launch_time")) { name = "Slow_launch_threads"; } cell = new PdfPCell(new Phrase(name, titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // xnTable.addCell(cell); cell = new PdfPCell(new Phrase(value, contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // xnTable.addCell(cell); // xnTable.endHeaders(); } } } document.add(xnTable); document.add(new Paragraph("\n")); // PdfPTable connTable = new PdfPTable(6); float[] cwidth = { 220f, 220f, 220f, 220f, 220f, 220f }; connTable.setWidths(cwidth); connTable.setWidthPercentage(100); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setColspan(6); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); if (sessionlist != null && sessionlist.size() > 0) { int rowI = 1; for (int i = 0; i < sessionlist.size(); i++) { List ipsessionlist = (List) sessionlist.get(i); if (ipsessionlist != null && ipsessionlist.size() > 0) { for (int k = 0; k < ipsessionlist.size(); k++) { String[] sessions = (String[]) ipsessionlist.get(k); if (sessions != null && sessions.length == 5) { cell = new PdfPCell(new Phrase(String.valueOf(rowI), contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(sessions[4], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(sessions[0], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(sessions[1], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(sessions[2], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); cell = new PdfPCell(new Phrase(sessions[3], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // connTable.addCell(cell); // connTable.endHeaders(); rowI++; } } } } } document.add(connTable); document.add(new Paragraph("\n")); // PdfPTable tabTable = new PdfPTable(5); float[] tabwidth = { 220f, 220f, 220f, 220f, 220f }; tabTable.setWidths(tabwidth); tabTable.setWidthPercentage(100); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setColspan(5); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); String[] dbs = vo.getDbName().split(","); if (dbs != null && dbs.length > 0) { int rowI = 1; for (int i = 0; i < dbs.length; i++) { String dbStr = dbs[i]; // System.out.println(dbStr+"====="+tablesHash.size()); if (tablesHash.containsKey(dbStr)) { List tableslist = (List) tablesHash.get(dbStr); if (tableslist != null && tableslist.size() > 0) { for (int k = 0; k < tableslist.size(); k++) { String[] tables = (String[]) tableslist.get(k); if (tables != null && tables.length == 4) { cell = new PdfPCell(new Phrase(String.valueOf(rowI), contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(tables[0], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(tables[1], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(tables[2], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); cell = new PdfPCell(new Phrase(tables[3], contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // tabTable.addCell(cell); // tabTable.endHeaders(); rowI++; } } } } } } document.add(tabTable); document.add(new Paragraph("\n")); // PdfPTable stateTable = new PdfPTable(3); float[] swidth = { 220f, 220f, 220f }; stateTable.setWidths(swidth); stateTable.setWidthPercentage(100); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setColspan(3); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); cell = new PdfPCell(new Phrase(" ", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); if (tableinfo_v != null) { int rowI = 1; for (int i = 0; i < tableinfo_v.size(); i++) { Hashtable ht = (Hashtable) tableinfo_v.get(i); String size = ht.get("variable_name").toString(); String free = ht.get("value").toString(); if (size.equalsIgnoreCase("auto_increment_increment")) { size = ""; } if (size.equalsIgnoreCase("auto_increment_offset")) { size = "AUTO_INCREMENT"; } if (size.equalsIgnoreCase("automatic_sp_privileges")) { size = "automatic_sp_privileges"; } if (size.equalsIgnoreCase("back_log")) { size = ""; } if (size.equalsIgnoreCase("basedir")) { size = "MySQL"; } if (size.equalsIgnoreCase("binlog_cache_size")) { size = "SQL"; } if (size.equalsIgnoreCase("bulk_insert_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("character_set_client")) { size = ""; } if (size.equalsIgnoreCase("character_set_connection")) { size = ""; } if (size.equalsIgnoreCase("character_set_database")) { size = ""; } if (size.equalsIgnoreCase("character_set_filesystem")) { size = "character_set_filesystem"; } if (size.equalsIgnoreCase("character_set_results")) { size = ""; } if (size.equalsIgnoreCase("character_set_server")) { size = ""; } if (size.equalsIgnoreCase("character_set_system")) { size = ""; } if (size.equalsIgnoreCase("character_sets_dir")) { size = ""; } if (size.equalsIgnoreCase("collation_connection")) { size = ""; } if (size.equalsIgnoreCase("collation_database")) { size = ""; } if (size.equalsIgnoreCase("collation_server")) { size = ""; } if (size.equalsIgnoreCase("completion_type")) { size = ""; } if (size.equalsIgnoreCase("concurrent_insert")) { size = ""; } if (size.equalsIgnoreCase("connect_timeout")) { size = "Bad handshake"; } if (size.equalsIgnoreCase("datadir")) { size = "MySQL"; } if (size.equalsIgnoreCase("date_format")) { size = "date_format()"; } if (size.equalsIgnoreCase("datetime_format")) { size = "datetime_format()"; } if (size.equalsIgnoreCase("default_week_format")) { size = "WEEK() "; } if (size.equalsIgnoreCase("delay_key_write")) { size = "DELAY_KEY_WRITE"; } if (size.equalsIgnoreCase("delayed_insert_limit")) { size = "INSERT DELAYEDSELECT"; } if (size.equalsIgnoreCase("delayed_insert_timeout")) { size = "INSERT DELAYEDINSERT"; } if (size.equalsIgnoreCase("delayed_queue_size")) { size = "INSERT DELAYED"; } if (size.equalsIgnoreCase("div_precision_increment")) { size = "/"; } if (size.equalsIgnoreCase("engine_condition_pushdown")) { size = "NDB"; } if (size.equalsIgnoreCase("expire_logs_days")) { size = ""; } if (size.equalsIgnoreCase("flush")) { size = "flushmysqld"; } if (size.equalsIgnoreCase("flush_time")) { size = ""; } if (size.equalsIgnoreCase("ft_boolean_syntax")) { size = "IN BOOLEAN MODE"; } if (size.equalsIgnoreCase("ft_max_word_len")) { size = "FULLTEXT"; } if (size.equalsIgnoreCase("ft_min_word_len")) { size = "FULLTEXT"; } if (size.equalsIgnoreCase("ft_query_expansion_limit")) { size = "WITH QUERY EXPANSION"; } if (size.equalsIgnoreCase("ft_stopword_file")) { size = ""; } if (size.equalsIgnoreCase("group_concat_max_len")) { size = "GROUP_CONCAT()"; } if (size.equalsIgnoreCase("have_archive")) { size = "mysqldARCHIVE"; } if (size.equalsIgnoreCase("have_bdb")) { size = "mysqldBDB"; } if (size.equalsIgnoreCase("have_blackhole_engine")) { size = "mysqldBLACKHOLE"; } if (size.equalsIgnoreCase("have_compress")) { size = "zlib"; } if (size.equalsIgnoreCase("have_crypt")) { size = "crypt()"; } if (size.equalsIgnoreCase("have_csv")) { size = "mysqldARCHIVE"; } if (size.equalsIgnoreCase("have_example_engine")) { size = "mysqldEXAMPLE"; } if (size.equalsIgnoreCase("have_federated_engine")) { size = "mysqldFEDERATED"; } if (size.equalsIgnoreCase("have_geometry")) { size = ""; } if (size.equalsIgnoreCase("have_innodb")) { size = "mysqldInnoDB"; } if (size.equalsIgnoreCase("have_isam")) { size = ""; } if (size.equalsIgnoreCase("have_ndbcluster")) { size = "mysqldNDB CLUSTER"; } if (size.equalsIgnoreCase("have_openssl")) { size = "mysqld/SSL()"; } if (size.equalsIgnoreCase("have_query_cache")) { size = "mysqld"; } if (size.equalsIgnoreCase("have_raid")) { size = "mysqldRAID"; } if (size.equalsIgnoreCase("have_rtree_keys")) { size = "RTREE"; } if (size.equalsIgnoreCase("have_symlink")) { size = ""; } if (size.equalsIgnoreCase("init_connect")) { size = ""; } if (size.equalsIgnoreCase("init_file")) { size = "--init-file"; } if (size.equalsIgnoreCase("init_slave")) { size = "SQL"; } if (size.equalsIgnoreCase("innodb_additional_mem_pool_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_autoextend_increment")) { size = ""; } if (size.equalsIgnoreCase("innodb_buffer_pool_awe_mem_mb")) { size = "32WindowsAWE"; } if (size.equalsIgnoreCase("innodb_buffer_pool_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_checksums")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_commit_concurrency")) { size = "innodb_commit_concurrency"; } if (size.equalsIgnoreCase("innodb_concurrency_tickets")) { size = "innodb_concurrency_tickets"; } if (size.equalsIgnoreCase("innodb_data_file_path")) { size = ""; } if (size.equalsIgnoreCase("innodb_data_home_dir")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_doublewrite")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_fast_shutdown")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_file_io_threads")) { size = "InnoDBI/O"; } if (size.equalsIgnoreCase("innodb_file_per_table")) { size = "InnoDB.ibd"; } if (size.equalsIgnoreCase("innodb_flush_log_at_trx_commit")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_flush_method")) { size = "InnoDBfsync()"; } if (size.equalsIgnoreCase("innodb_force_recovery")) { size = ""; } if (size.equalsIgnoreCase("innodb_lock_wait_timeout")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_locks_unsafe_for_binlog")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_log_arch_dir")) { size = " "; } if (size.equalsIgnoreCase("innodb_log_archive")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_buffer_size")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_log_file_size")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_files_in_group")) { size = ""; } if (size.equalsIgnoreCase("innodb_log_group_home_dir")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_max_dirty_pages_pct")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_max_purge_lag")) { size = "INSERT,UPDATEDELETE"; } if (size.equalsIgnoreCase("innodb_mirrored_log_groups")) { size = ""; } if (size.equalsIgnoreCase("innodb_open_files")) { size = "InnoDB.ibd"; } if (size.equalsIgnoreCase("innodb_support_xa")) { size = "InnoDBXA"; } if (size.equalsIgnoreCase("innodb_sync_spin_loops")) { size = "innodb_sync_spin_loops"; } if (size.equalsIgnoreCase("innodb_table_locks")) { size = "InnoDB"; } if (size.equalsIgnoreCase("innodb_thread_concurrency")) { size = "InnoDBInnoDB"; } if (size.equalsIgnoreCase("innodb_thread_sleep_delay")) { size = "InnoDBSHOW INNODB STATUS<datadir>/innodb_status"; } if (size.equalsIgnoreCase("interactive_timeout")) { size = ""; } if (size.equalsIgnoreCase("join_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("key_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("key_cache_age_threshold")) { size = "(sub-chain)(sub-chain)"; } if (size.equalsIgnoreCase("key_cache_block_size")) { size = ""; } if (size.equalsIgnoreCase("key_cache_division_limit")) { size = ""; } if (size.equalsIgnoreCase("language")) { size = ""; } if (size.equalsIgnoreCase("large_files_support")) { size = "mysqld"; } if (size.equalsIgnoreCase("large_page_size")) { size = "large_page_size"; } if (size.equalsIgnoreCase("large_pages")) { size = ""; } if (size.equalsIgnoreCase("license")) { size = ""; } if (size.equalsIgnoreCase("local_infile")) { size = "LOCALLOAD DATA INFILE"; } if (size.equalsIgnoreCase("log")) { size = ""; } if (size.equalsIgnoreCase("log_bin")) { size = ""; } if (size.equalsIgnoreCase("log_bin_trust_function_creators")) { size = ""; } if (size.equalsIgnoreCase("log_error")) { size = ""; } if (size.equalsIgnoreCase("log_slave_updates")) { size = ""; } if (size.equalsIgnoreCase("log_slow_queries")) { size = ""; } if (size.equalsIgnoreCase("log_warnings")) { size = ""; } if (size.equalsIgnoreCase("long_query_time")) { size = "Slow_queries"; } if (size.equalsIgnoreCase("low_priority_updates")) { size = "sqlSELECTLOCK TABLE READ"; } if (size.equalsIgnoreCase("lower_case_file_system")) { size = ""; } if (size.equalsIgnoreCase("lower_case_table_names")) { size = "1"; } if (size.equalsIgnoreCase("max_allowed_packet")) { size = "/"; } if (size.equalsIgnoreCase("max_binlog_cache_size")) { size = ""; } if (size.equalsIgnoreCase("max_binlog_size")) { size = ""; } if (size.equalsIgnoreCase("max_connect_errors")) { size = ""; } if (size.equalsIgnoreCase("max_connections")) { size = ""; } if (size.equalsIgnoreCase("max_delayed_threads")) { size = "INSERT DELAYED"; } if (size.equalsIgnoreCase("max_error_count")) { size = "SHOW ERRORSSHOW WARNINGS"; } if (size.equalsIgnoreCase("max_heap_table_size")) { size = "MEMORY (HEAP)"; } if (size.equalsIgnoreCase("max_insert_delayed_threads")) { size = "INSERT DELAYED(max_delayed_threads)"; } if (size.equalsIgnoreCase("max_join_size")) { size = "max_join_size"; } if (size.equalsIgnoreCase("max_length_for_sort_data")) { size = "filesort"; } if (size.equalsIgnoreCase("max_prepared_stmt_count")) { size = "max_prepared_stmt_count"; } if (size.equalsIgnoreCase("max_relay_log_size")) { size = ""; } if (size.equalsIgnoreCase("max_seeks_for_key")) { size = ""; } if (size.equalsIgnoreCase("max_sort_length")) { size = "BLOBTEXT"; } if (size.equalsIgnoreCase("max_sp_recursion_depth")) { size = "max_sp_recursion_depth"; } if (size.equalsIgnoreCase("max_tmp_tables")) { size = ""; } if (size.equalsIgnoreCase("max_user_connections")) { size = "MySQL"; } if (size.equalsIgnoreCase("max_write_lock_count")) { size = ""; } if (size.equalsIgnoreCase("multi_range_count")) { size = "multi_range_count"; } if (size.equalsIgnoreCase("myisam_data_pointer_size")) { size = ""; } if (size.equalsIgnoreCase("myisam_max_sort_file_size")) { size = "MyISAMMySQL"; } if (size.equalsIgnoreCase("myisam_recover_options")) { size = "myisam-recover"; } if (size.equalsIgnoreCase("myisam_repair_threads")) { size = "1Repair by sortingMyISAM"; } if (size.equalsIgnoreCase("myisam_sort_buffer_size")) { size = "REPAIR TABLECREATE INDEXALTER TABLEMyISAM"; } if (size.equalsIgnoreCase("myisam_stats_method")) { size = "MyISAMNULL"; } if (size.equalsIgnoreCase("named_pipe")) { size = ""; } if (size.equalsIgnoreCase("net_buffer_length")) { size = ""; } if (size.equalsIgnoreCase("net_read_timeout")) { size = ""; } if (size.equalsIgnoreCase("net_retry_count")) { size = ""; } if (size.equalsIgnoreCase("net_write_timeout")) { size = ""; } if (size.equalsIgnoreCase("new")) { size = "MySQL 4.04.1"; } if (size.equalsIgnoreCase("old_passwords")) { size = "MySQLpre-4.1-style"; } if (size.equalsIgnoreCase("open_files_limit")) { size = "mysqld"; } if (size.equalsIgnoreCase("optimizer_prune_level")) { size = " 0"; } if (size.equalsIgnoreCase("optimizer_search_depth")) { size = ""; } if (size.equalsIgnoreCase("pid_file")) { size = "ID (PID)"; } if (size.equalsIgnoreCase("prepared_stmt_count")) { size = "prepared_stmt_count"; } if (size.equalsIgnoreCase("port")) { size = "TCP/IP"; } if (size.equalsIgnoreCase("preload_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("protocol_version")) { size = "MySQL/"; } if (size.equalsIgnoreCase("query_alloc_block_size")) { size = ""; } if (size.equalsIgnoreCase("query_cache_limit")) { size = ""; } if (size.equalsIgnoreCase("query_cache_min_res_unit")) { size = "()"; } if (size.equalsIgnoreCase("query_cache_size")) { size = ""; } if (size.equalsIgnoreCase("query_cache_type")) { size = ""; } if (size.equalsIgnoreCase("query_cache_wlock_invalidate")) { size = "WRITE"; } if (size.equalsIgnoreCase("query_prealloc_size")) { size = ""; } if (size.equalsIgnoreCase("range_alloc_block_size")) { size = ""; } if (size.equalsIgnoreCase("read_buffer_size")) { size = "()"; } if (size.equalsIgnoreCase("read_only")) { size = "ON"; } if (size.equalsIgnoreCase("read_only")) { size = "ON"; } if (size.equalsIgnoreCase("relay_log_purge")) { size = ""; } if (size.equalsIgnoreCase("read_rnd_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("secure_auth")) { size = "--secure-authMySQL(4.1)"; } if (size.equalsIgnoreCase("shared_memory")) { size = "(Windows)"; } if (size.equalsIgnoreCase("shared_memory_base_name")) { size = "(Windows)"; } if (size.equalsIgnoreCase("server_id")) { size = ""; } if (size.equalsIgnoreCase("skip_external_locking")) { size = "mysqld"; } if (size.equalsIgnoreCase("skip_networking")) { size = "(TCP/IP)"; } if (size.equalsIgnoreCase("skip_show_database")) { size = "SHOW DATABASESSHOW DATABASES"; } if (size.equalsIgnoreCase("slave_compressed_protocol")) { size = "/"; } if (size.equalsIgnoreCase("slave_load_tmpdir")) { size = "LOAD DATA INFILE"; } if (size.equalsIgnoreCase("slave_net_timeout")) { size = "/"; } if (size.equalsIgnoreCase("slave_skip_errors")) { size = "()"; } if (size.equalsIgnoreCase("slave_transaction_retries")) { size = "SQLslave_transaction_retries"; } if (size.equalsIgnoreCase("slow_launch_time")) { size = "Slow_launch_threads"; } if (size.equalsIgnoreCase("sort_buffer_size")) { size = ""; } if (size.equalsIgnoreCase("sql_mode")) { size = "SQL"; } if (size.equalsIgnoreCase("storage_engine")) { size = "table_typeisMySQL 5.1,storage_engine"; } if (size.equalsIgnoreCase("sync_binlog")) { size = "sync_binlog'thMySQL"; } if (size.equalsIgnoreCase("sync_frm")) { size = "1,.frm"; } if (size.equalsIgnoreCase("system_time_zone")) { size = ""; } if (size.equalsIgnoreCase("table_cache")) { size = ""; } if (size.equalsIgnoreCase("table_type")) { size = "()"; } if (size.equalsIgnoreCase("thread_cache_size")) { size = ""; } if (size.equalsIgnoreCase("thread_stack")) { size = ""; } if (size.equalsIgnoreCase("time_format")) { size = ""; } if (size.equalsIgnoreCase("time_zone")) { size = ""; } if (size.equalsIgnoreCase("tmp_table_size")) { size = "MySQLMyISAM"; } if (size.equalsIgnoreCase("tmpdir")) { size = ""; } if (size.equalsIgnoreCase("transaction_alloc_block_size")) { size = "()"; } if (size.equalsIgnoreCase("transaction_prealloc_size")) { size = "transaction_alloc_blocks"; } if (size.equalsIgnoreCase("tx_isolation")) { size = ""; } if (size.equalsIgnoreCase("updatable_views_with_limit")) { size = "LIMIT"; } if (size.equalsIgnoreCase("version")) { size = ""; } if (size.equalsIgnoreCase("version_bdb")) { size = "BDB"; } if (size.equalsIgnoreCase("version_comment")) { size = "configure--with-commentMySQL"; } if (size.equalsIgnoreCase("version_compile_machine")) { size = "MySQL"; } if (size.equalsIgnoreCase("version_compile_os")) { size = "MySQL"; } if (size.equalsIgnoreCase("wait_timeout")) { size = ""; } cell = new PdfPCell(new Phrase(String.valueOf(rowI), contextFont));// mark cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); cell = new PdfPCell(new Phrase(size, contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); cell = new PdfPCell(new Phrase(free, contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // stateTable.addCell(cell); rowI++; } } document.add(stateTable); document.add(new Paragraph("\n")); // PdfPTable eventTable = new PdfPTable(2); float[] eventWidths = { 220f, 220f }; eventTable.setWidths(eventWidths); eventTable.setWidthPercentage(100); cell = new PdfPCell(new Phrase("", titleFont)); cell.setColspan(2); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // eventTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // eventTable.addCell(cell); cell = new PdfPCell(new Phrase("", titleFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // eventTable.addCell(cell); cell = new PdfPCell(new Phrase((String) reportHash.get("downnum"), contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // eventTable.addCell(cell); cell = new PdfPCell(new Phrase(reportHash.get("count") + "", contextFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); // cell.setVerticalAlignment(Element.ALIGN_MIDDLE); // eventTable.addCell(cell); document.add(eventTable); document.add(new Paragraph("\n")); // addEventLisToPdf(document); document.close(); } catch (Exception e) { // SysLogger.error("Error in ExcelReport.createReport()",e); SysLogger.error("", e); } }
From source file:com.aryjr.nheengatu.pdf.PDFText.java
License:Open Source License
public static Paragraph createParagraph(final Text htmlText, TagsManager tm) { if (tm == null) tm = TagsManager.getInstance();//from w w w . ja v a2 s.com final Paragraph text = new Paragraph(htmlText != null ? htmlText.getText() : null, tm.getFont()); text.setAlignment(tm.getAlign()); text.setKeepTogether(true); // float b = tm.getSpacingBefore(); // float a = tm.getSpacingAfter(); text.setSpacingBefore(tm.getSpacingBefore()); text.setSpacingAfter(tm.getSpacingAfter()); text.setFirstLineIndent(tm.getTextIndent()); text.setIndentationLeft(tm.getMarginLeft()); // text.setFirstLineIndent(20f); text.setLeading(tm.getFont().getSize() * 1.5f); return text; }
From source file:com.centurylink.mdw.designer.pages.ExportHelper.java
License:Apache License
private Object generateElementHtml(Element element, int depth, Font font) { String tag = element.getName(); Object myself;//from w w w . j av a 2 s.co m Object av; if (element instanceof HTMLDocument.RunElement) { HTMLDocument.RunElement re = (HTMLDocument.RunElement) element; int start = re.getStartOffset(); int end = re.getEndOffset(); try { String content = re.getDocument().getText(start, end - start); HtmlAttr htmlattr = printAttributesHtml(re); av = re.getAttribute(CSS.Attribute.FONT_SIZE); String fontsize = av == null ? null : av.toString(); av = re.getAttribute(CSS.Attribute.FONT_FAMILY); String fontfamily = av == null ? null : av.toString(); av = re.getAttribute(CSS.Attribute.COLOR); String fontcolor = av == null ? null : av.toString(); if (fontcolor != null || fontsize != null || fontfamily != null) { if (fontfamily == null) fontfamily = font.getFamilyname(); if (fontsize != null && fontsize.endsWith("pt")) fontsize = fontsize.substring(0, fontsize.indexOf("pt")); float size = fontsize == null ? font.getSize() : (Float.parseFloat(fontsize) + 8); int style = font.getStyle(); Color color; if (fontcolor != null) { color = Color.decode(fontcolor); } else color = font.getColor(); font = FontFactory.getFont(fontfamily, size, style, color); } else if (htmlattr.bold || htmlattr.italic) { String family = font.getFamilyname(); float size = font.getSize(); Color color = font.getColor(); if (htmlattr.bold && htmlattr.italic) font = FontFactory.getFont(family, size, Font.BOLDITALIC, color); else if (htmlattr.italic) font = FontFactory.getFont(family, size, Font.ITALIC, color); else if (htmlattr.bold) font = FontFactory.getFont(family, size, Font.BOLD); } myself = new Chunk(content, font); } catch (BadLocationException e) { e.printStackTrace(); myself = null; } } else if (element instanceof HTMLDocument.BlockElement) { HTMLDocument.BlockElement be = (HTMLDocument.BlockElement) element; HtmlAttr htmlattr = printAttributesHtml(be); if (htmlattr.bold) { System.out.println("+++BOLD!!!"); } av = be.getAttribute(javax.swing.text.html.HTML.Attribute.ALIGN); String align = av == null ? null : av.toString(); if (htmlattr.bold || htmlattr.italic) { String family = font.getFamilyname(); float size = font.getSize(); Color color = font.getColor(); if (htmlattr.bold && htmlattr.italic) font = FontFactory.getFont(family, size, Font.BOLDITALIC, color); else if (htmlattr.italic) font = FontFactory.getFont(family, size, Font.ITALIC, color); else if (htmlattr.bold) font = FontFactory.getFont(family, size, Font.BOLD, Color.blue); } if (tag.equalsIgnoreCase("html")) { myself = generateElementChildrenHtml(element, depth + 1, font); } else if (tag.equalsIgnoreCase("head")) { myself = null; } else if (tag.equalsIgnoreCase("body")) { myself = generateElementChildrenHtml(element, depth + 1, font); } else if (tag.equalsIgnoreCase("p") || tag.equalsIgnoreCase("p-implied")) { List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); Paragraph paragraph = new Paragraph(); paragraph.setFirstLineIndent(0F); for (Object child : children) { if (child instanceof Chunk) { Chunk chunk = (Chunk) child; /*if (!chunk.getContent().equals("\n"))*/ paragraph.add(chunk); } else paragraph.add(child); } if (align != null) paragraph.setAlignment(align); myself = paragraph; } else if (tag.equalsIgnoreCase("h1") || tag.equalsIgnoreCase("h2") || tag.equalsIgnoreCase("h3")) { List<Object> children = generateElementChildrenHtml(element, depth + 1, subSectionFont); Paragraph title = new Paragraph(); for (Object child : children) { title.add(child); } myself = new TempSectionPdf(title); } else if (tag.equalsIgnoreCase("ul")) { com.lowagie.text.List list = new com.lowagie.text.List(false, false, 20.0f); list.setIndentationLeft(25.0f); List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); for (Object child : children) { list.add(child); } myself = list; } else if (tag.equalsIgnoreCase("ol")) { com.lowagie.text.List list = new com.lowagie.text.List(true, false, 20.0f); list.setIndentationLeft(25.0f); List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); for (Object child : children) { list.add(child); } myself = list; } else if (tag.equalsIgnoreCase("li")) { ListItem li = new ListItem(); li.setSpacingAfter(0.0f); List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); for (Object child : children) { li.add(child); } myself = li; } else if (tag.equalsIgnoreCase("table")) { List<Object> rows = generateElementChildrenHtml(element, depth + 1, normalFont); try { int ncols = 0; for (Object row : rows) { if (row instanceof List<?>) { int n = ((List<?>) row).size(); if (n > ncols) ncols = n; } } Table table = new Table(2); table.setBorderWidth(1); table.setBorderColor(new Color(0, 128, 128)); table.setPadding(1.0f); table.setSpacing(0.5f); Cell c = new Cell("header"); c.setHeader(true); c.setColspan(ncols); table.addCell(c); table.endHeaders(); for (Object row : rows) { if (row instanceof List<?>) { for (Object cell : (List<?>) row) { if (cell instanceof Cell) table.addCell((Cell) cell); } } } myself = table; } catch (BadElementException e) { e.printStackTrace(); myself = null; } } else if (tag.equalsIgnoreCase("tr")) { List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); myself = children; } else if (tag.equalsIgnoreCase("td")) { Cell cell = new Cell(); List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); for (Object child : children) { cell.add(child); } myself = cell; } else if (tag.equalsIgnoreCase("div")) { List<Object> children = generateElementChildrenHtml(element, depth + 1, normalFont); Paragraph paragraph = new Paragraph(); paragraph.setFirstLineIndent(0F); for (Object child : children) { paragraph.add(child); } if (align != null) paragraph.setAlignment(align); myself = paragraph; } else { System.err.println("Unknown element " + element.getName()); myself = null; } } else { myself = null; // could be BidiElement - not sure what it is } return myself; }
From source file:com.macrosoft.icms.util.PDFCreator.java
public static void createPdfByData(String fileName, String path, Map dataMap) { Document document = new Document(PageSize.A4.rotate(), 50, 50, 50, 50); String opetype = (String) dataMap.get("opetype"); try {//ww w . j av a 2s. c o m //PDF File file = new File(path); if (!file.exists()) { file.mkdirs(); } PdfWriter.getInstance(document, new FileOutputStream(path + fileName)); //PDF document.open(); // BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); Font titleChinese = new Font(bfChinese, 30, Font.BOLD); //table Font contentFont = new Font(bfChinese, 16, Font.NORMAL); //table Font tblTitleFont = new Font(bfChinese, 16, Font.BOLD); //PDF Paragraph title = new Paragraph((String) dataMap.get("title"), titleChinese); title.setAlignment(Paragraph.ALIGN_CENTER); document.add(title); Paragraph attionTitle = new Paragraph("", contentFont); attionTitle.setAlignment(Paragraph.ALIGN_CENTER); if ("GT".equals(opetype)) { Map<String, String> gtMap = (Map<String, String>) dataMap.get("gtMap"); Table gtxxtable = new Table(5); int gtxxwidths[] = { 30, 15, 20, 15, 20 }; gtxxtable.setWidths(gtxxwidths); gtxxtable.setWidth(100); gtxxtable.setPadding(3); gtxxtable.setBorderWidth(1); gtxxtable.setAlignment(Cell.ALIGN_CENTER); Cell cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("traname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(4); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setRowspan(7); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("name"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("sex"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("cerno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(3); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("dom"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(3); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("postalcode"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("tel"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("email"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(3); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("polstand"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("nation"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("litedeg"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("occstbeapp"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setRowspan(2); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("grjy"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(4); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("jtjy"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("fammember"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(2); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("busscoandform"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(4); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("oploc"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(4); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("empnum"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); gtxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); gtxxtable.addCell(cell); cell = new Cell(new Phrase(gtMap == null ? "" : gtMap.get("capam"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_LEFT); cell.setColspan(2); gtxxtable.addCell(cell); Paragraph p1 = new Paragraph( "\n ", contentFont); Paragraph p2 = new Paragraph(" ", contentFont); p2.setIndentationLeft(500); Paragraph p3 = new Paragraph(" ", contentFont); p3.setIndentationLeft(500); cell = new Cell(); cell.add(p1); cell.add(p2); cell.add(p3); cell.setColspan(5); gtxxtable.addCell(cell); document.add(gtxxtable); Paragraph wtitle = new Paragraph("\n", titleChinese); wtitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(wtitle); Map<String, String> wtrMap = (Map<String, String>) dataMap.get("wtrMap"); Paragraph wtr = new Paragraph("\n :" + (wtrMap == null ? "" : wtrMap.get("sqr")), contentFont); document.add(wtr); wtr = new Paragraph(" " + (wtrMap == null ? "" : wtrMap.get("wtr")), contentFont); document.add(wtr); wtr = new Paragraph(" \n", contentFont); document.add(wtr); wtr = new Paragraph("1. " + (wtrMap == null ? " " : wtrMap.get("qx1")) + " ", contentFont); wtr.setIndentationLeft(100); document.add(wtr); wtr = new Paragraph("2. " + (wtrMap == null ? " " : wtrMap.get("qx2")) + " ", contentFont); wtr.setIndentationLeft(100); document.add(wtr); wtr = new Paragraph( "3. " + (wtrMap == null ? " " : wtrMap.get("qx3")) + " ", contentFont); wtr.setIndentationLeft(100); document.add(wtr); wtr = new Paragraph("4. " + (wtrMap == null ? " " : wtrMap.get("qx4")) + " ", contentFont); wtr.setIndentationLeft(100); document.add(wtr); wtr = new Paragraph("\n " + (wtrMap == null ? "" : wtrMap.get("confrom")) + " " + (wtrMap == null ? "" : wtrMap.get("conto")) + "\n", contentFont); document.add(wtr); Table t = new Table(4); int twidths[] = { 20, 30, 20, 30 }; t.setWidths(twidths); t.setWidth(100); t.setPadding(3); t.setBorderWidth(1); t.setAlignment(Cell.ALIGN_CENTER); Cell tCell = new Cell(new Phrase("", contentFont)); tCell.setColspan(2); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); tCell = new Cell(new Phrase(wtrMap == null ? "" : wtrMap.get("unit"), contentFont)); tCell.setColspan(2); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); tCell = new Cell(new Phrase("", contentFont)); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); tCell = new Cell(new Phrase(wtrMap == null ? "" : wtrMap.get("postalcode"), contentFont)); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); tCell = new Cell(new Phrase("", contentFont)); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); tCell = new Cell(new Phrase(wtrMap == null ? "" : wtrMap.get("tel"), contentFont)); tCell.setHorizontalAlignment(Element.ALIGN_CENTER); t.addCell(tCell); document.add(t); Paragraph pp = new Paragraph("\n", contentFont); document.add(pp); pp = new Paragraph(" ", contentFont); pp.setAlignment(Paragraph.ALIGN_RIGHT); document.add(pp); } else { // // Table jbxxtable = new Table(4); int jbxxwidths[] = { 20, 30, 20, 30 }; jbxxtable.setWidths(jbxxwidths); jbxxtable.setWidth(100); jbxxtable.setPadding(3); jbxxtable.setBorderWidth(1); jbxxtable.setAlignment(Cell.ALIGN_CENTER); // Cell jbxxTitle = new Cell(new Phrase("", tblTitleFont)); jbxxTitle.setColspan(4); jbxxTitle.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxTitle); Map<String, String> jbxxMap = (Map<String, String>) dataMap.get("jbxxMap"); if ("GS".equals(opetype) || "NZFR".equals(opetype) || "HHQY".equals(opetype) || "GRDZ".equals(opetype) || "WZGS".equals(opetype) || "WZHH".equals(opetype) || "HZS".equals(opetype) || "HZSFZ".equals(opetype)) { Cell jbxxName = new Cell(new Phrase(" ", contentFont)); jbxxName.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxName); Cell jbxxNameValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("entname"), contentFont)); jbxxNameValue.setColspan(3); jbxxtable.addCell(jbxxNameValue); Cell jbxxRegno = new Cell(new Phrase("/\n", contentFont)); jbxxRegno.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxRegno); if ("WZGS".equals(opetype)) { Cell jbxxRegnoValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("regno"), contentFont)); jbxxtable.addCell(jbxxRegnoValue); Cell gbc = new Cell(new Phrase("", contentFont)); gbc.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(gbc); gbc = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("country"), contentFont)); gbc.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(gbc); } else { Cell jbxxRegnoValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("regno"), contentFont)); jbxxRegnoValue.setColspan(3); jbxxtable.addCell(jbxxRegnoValue); } } else if ("FGS".equals(opetype) || "NZYY".equals(opetype) || "HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { String lsdw = ""; if ("NZYY".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { lsdw = ""; } Cell cell = null; if (!"HHFZ".equals(opetype) && !"GRDZFZ".equals(opetype)) { cell = new Cell(new Phrase(lsdw, contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("supentname"), contentFont)); jbxxtable.addCell(cell); cell = new Cell(new Phrase("/", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("supregno"), contentFont)); jbxxtable.addCell(cell); } String fgsname = ""; if ("NZYY".equals(opetype)) { fgsname = ""; } else if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { fgsname = ""; } cell = new Cell(new Phrase(fgsname, contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("entname"), contentFont)); jbxxtable.addCell(cell); String regname = "//"; if ("NZYY".equals(opetype)) { regname = "//"; } else if ("NZYY".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype)) { regname = "//"; } cell = new Cell(new Phrase(regname, contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regno"), contentFont)); jbxxtable.addCell(cell); } if ("WGJY".equals(opetype)) { Cell cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("entname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("/", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("dom"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else if ("WGDB".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("entname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("/", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("dom"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else { String domname = ""; if ("FGS".equals(opetype) || "WZHHFZ".equals(opetype)) { domname = ""; } else if ("GRDZ".equals(opetype)) { domname = ""; } else if ("GRDZFZ".equals(opetype) || "HHFZ".equals(opetype) || "HZSFZ".equals(opetype)) { domname = ""; } else if ("WZHH".equals(opetype) || "HHQY".equals(opetype)) { domname = ""; } Cell jbxxDom = new Cell(new Phrase(domname, contentFont)); jbxxDom.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxDom); Cell jbxxDomValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("dom"), contentFont)); jbxxDomValue.setColspan(3); jbxxtable.addCell(jbxxDomValue); Cell jbxxOploc = new Cell(new Phrase("", contentFont)); jbxxOploc.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxOploc); Cell jbxxOplocValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("oploc"), contentFont)); jbxxOplocValue.setColspan(3); jbxxtable.addCell(jbxxOplocValue); } Cell jbxxTel = new Cell(new Phrase("", contentFont)); jbxxTel.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxTel); Cell jbxxTelValue = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("tel"), contentFont)); jbxxTelValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxTelValue); Cell jbxxEmail = new Cell(new Phrase("", contentFont)); jbxxEmail.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxEmail); Cell jbxxEmailValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("postalcode"), contentFont)); jbxxEmailValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxEmailValue); // String slname = " "; if ("NZFR".equals(opetype) || "NZYY".equals(opetype) || "WGJY".equals(opetype)) { slname = ""; } Cell slTitle = new Cell(new Phrase(slname, tblTitleFont)); slTitle.setColspan(4); slTitle.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(slTitle); if ("GS".equals(opetype) || "NZFR".equals(opetype) || "WZGS".equals(opetype)) { Cell jbxxLerep = new Cell(new Phrase("", contentFont)); jbxxLerep.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxLerep); Cell jbxxLerepValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); jbxxLerepValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxLerepValue); if ("WZGS".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("country"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("position"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("congro"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("congrocur"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("congrousd"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("enttype"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("insform"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("\n\n\n", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else { Cell jbxxPosition = new Cell(new Phrase(" ", contentFont)); jbxxPosition.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxPosition); Cell jbxxPositionValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("position"), contentFont)); jbxxPositionValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxPositionValue); String regcapname = ""; if ("NZFR".equals(opetype)) { regcapname = ""; } Cell jbxxRegcap = new Cell(new Phrase(regcapname, contentFont)); jbxxRegcap.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxRegcap); Cell jbxxRegcapValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); jbxxRegcapValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxRegcapValue); String enttypename = ""; if ("NZFR".equals(opetype)) { enttypename = ""; } Cell jbxxEnttype = new Cell(new Phrase(enttypename, contentFont)); jbxxEnttype.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxEnttype); Cell jbxxEnttypeValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("enttype"), contentFont)); jbxxEnttypeValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxEnttypeValue); } if ("GS".equals(opetype)) { Cell jbxxInsform = new Cell(new Phrase("\n", contentFont)); jbxxInsform.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxInsform); Cell jbxxInsformValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("insform"), contentFont)); jbxxInsformValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxInsformValue.setColspan(3); jbxxtable.addCell(jbxxInsformValue); Cell jbxxBusscope = new Cell(new Phrase("\n\n\n", contentFont)); jbxxBusscope.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxBusscope); Cell jbxxBusscopeValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); jbxxBusscopeValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxBusscopeValue.setColspan(3); jbxxtable.addCell(jbxxBusscopeValue); } Cell jbxxOpfyears = new Cell(new Phrase("", contentFont)); jbxxOpfyears.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxOpfyears); Cell jbxxOpfyearsValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("opfyears"), contentFont)); jbxxOpfyearsValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxOpfyearsValue); Cell jbxxConum = new Cell(new Phrase("", contentFont)); jbxxConum.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxConum); Cell jbxxConumValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("conum"), contentFont)); jbxxConumValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxConumValue); if ("NZFR".equals(opetype)) { Cell jbxxBusscope = new Cell(new Phrase("\n\n\n", contentFont)); jbxxBusscope.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(jbxxBusscope); Cell jbxxBusscopeValue = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); jbxxBusscopeValue.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxBusscopeValue.setColspan(3); jbxxtable.addCell(jbxxBusscopeValue); } } else if ("FGS".equals(opetype) || "NZYY".equals(opetype) || "HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype) || "HZSFZ".equals(opetype)) { Cell cell = null; if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype)) { cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("houseadd"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("cerno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("empno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("tel"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("postalcode"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("yysj"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else { cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); jbxxtable.addCell(cell); if ("NZYY".equals(opetype)) { cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("tel"), contentFont)); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); jbxxtable.addCell(cell); } cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("conum"), contentFont)); jbxxtable.addCell(cell); } String bussname = ""; if ("FGS".equals(opetype)) { bussname = ""; } else if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { bussname = ""; } cell = new Cell(new Phrase(bussname, contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell( new Phrase(jbxxMap == null ? "" : jbxxMap.get("calculationmethod"), contentFont)); cell.setColspan(3); jbxxtable.addCell(cell); } else if ("HHQY".equals(opetype)) { Cell hhcell = new Cell(new Phrase("", contentFont)); hhcell.setRowspan(2); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(2); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell( new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(2); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("hhlx"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(3); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("hhcze"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(3); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("\n\n\n", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(3); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(" ______________________________________________", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(3); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("parnum"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("exenum"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase("", contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(hhcell); hhcell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("empnum"), contentFont)); hhcell.setHorizontalAlignment(Element.ALIGN_CENTER); hhcell.setColspan(3); jbxxtable.addCell(hhcell); } else if ("GRDZ".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("empnum"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("grczfs"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("\n\n\n", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else if ("WZHH".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("country"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("reccap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcapcur"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("enttype"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("\n\n\n", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("opfyears"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("conum"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); } else if ("WGJY".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("enttype"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("depincha"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("exaauth"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("sandate"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcapcur"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("yysj"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("itemofoporcpro"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentadd"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else if ("WGDB".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("yysj"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regorg"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("yysj"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("sandate"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("sandocno"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(4); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentforname"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentadd"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("cxqx"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentautsign"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forenliafor"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("country"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("forentscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } else if ("HZS".equals(opetype)) { Cell cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("lerep"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); cell = new Cell(new Phrase("", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("regcap"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); Paragraph p1 = new Paragraph(" " + dataMap.get("cyzs") + " ", contentFont); Paragraph p2 = new Paragraph(" " + dataMap.get("nmcy") + " " + dataMap.get("nmcyrate") + " %", contentFont); p2.setIndentationLeft(60); Paragraph p3 = new Paragraph(" " + dataMap.get("frcy") + " " + dataMap.get("frcyrate") + " %", contentFont); p3.setIndentationLeft(120); cell = new Cell(); cell.add(p1); cell.add(p2); cell.add(p3); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(4); jbxxtable.addCell(cell); cell = new Cell(new Phrase("\n\n\n", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); jbxxtable.addCell(cell); cell = new Cell(new Phrase(jbxxMap == null ? "" : jbxxMap.get("busscope"), contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(3); jbxxtable.addCell(cell); } document.add(jbxxtable); // //TABLE Table remarktable = new Table(6); int remarkwidths[] = { 15, 10, 20, 15, 20, 20 }; remarktable.setWidths(remarkwidths); remarktable.setWidth(100); remarktable.setPadding(3); remarktable.setBorderWidth(1); remarktable.setAlignment(Cell.ALIGN_CENTER); if ("GS".equals(opetype) || "NZFR".equals(opetype) || "HHQY".equals(opetype) || "HHFZ".equals(opetype) || "GRDZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZGS".equals(opetype) || "WZHH".equals(opetype) || "HZS".equals(opetype)) { Cell bgTitle = new Cell(new Phrase("", tblTitleFont)); bgTitle.setColspan(6); bgTitle.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(bgTitle); Cell bg1 = new Cell(new Phrase("", contentFont)); bg1.setColspan(2); bg1.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(bg1); Cell bg2 = new Cell(new Phrase("", contentFont)); bg2.setColspan(2); bg2.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(bg2); Cell bg3 = new Cell(new Phrase("", contentFont)); bg3.setColspan(2); bg3.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(bg3); for (int i = 0; i < 5; i++) { Cell bg11 = new Cell(""); bg11.setColspan(2); remarktable.addCell(bg11); Cell bg21 = new Cell(" "); bg21.setColspan(2); remarktable.addCell(bg21); Cell bg31 = new Cell(" "); bg31.setColspan(2); remarktable.addCell(bg31); } if ("GS".equals(opetype) || "HHQY".equals(opetype) || "GRDZ".equals(opetype) || "WZGS".equals(opetype) || "WZHH".equals(opetype) || "HZS".equals(opetype)) { Cell baTitle = new Cell(new Phrase(" ", tblTitleFont)); baTitle.setColspan(6); baTitle.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(baTitle); Cell fgsCell = new Cell(new Phrase("\n", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); fgsCell.setRowspan(2); remarktable.addCell(fgsCell); Cell nameCell = new Cell(new Phrase("", contentFont)); nameCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nameCell); Cell nameValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(nameValueCell); Cell regnoCell = new Cell(new Phrase("/", contentFont)); regnoCell.setHorizontalAlignment(Element.ALIGN_CENTER); regnoCell.setColspan(2); remarktable.addCell(regnoCell); Cell regnoValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(regnoValueCell); Cell djjgCell = new Cell(new Phrase("", contentFont)); djjgCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(djjgCell); Cell djjgValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(djjgValueCell); Cell djrqCell = new Cell(new Phrase("", contentFont)); djrqCell.setHorizontalAlignment(Element.ALIGN_CENTER); djrqCell.setColspan(2); remarktable.addCell(djrqCell); Cell djrqValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(djrqValueCell); if ("GRDZ".equals(opetype)) { Cell qtc = new Cell(new Phrase("", contentFont)); qtc.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(qtc); qtc = new Cell(new Phrase(" ", contentFont)); qtc.setHorizontalAlignment(Element.ALIGN_CENTER); qtc.setColspan(5); remarktable.addCell(qtc); } else { Cell qszCell = new Cell(new Phrase("", contentFont)); qszCell.setHorizontalAlignment(Element.ALIGN_CENTER); qszCell.setRowspan(2); remarktable.addCell(qszCell); Cell cyCell = new Cell(new Phrase("", contentFont)); cyCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(cyCell); Cell cyValueCell = new Cell(new Phrase("", contentFont)); cyValueCell.setColspan(4); remarktable.addCell(cyValueCell); Cell fzrCell = new Cell(new Phrase("", contentFont)); fzrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fzrCell); Cell fzrValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(fzrValueCell); Cell lxdhCell = new Cell(new Phrase("", contentFont)); lxdhCell.setHorizontalAlignment(Element.ALIGN_CENTER); lxdhCell.setColspan(2); remarktable.addCell(lxdhCell); Cell lxdhValueCell = new Cell(new Phrase("", contentFont)); remarktable.addCell(lxdhValueCell); } if ("GS".equals(opetype) || "WZGS".equals(opetype)) { Cell qtCell = new Cell(new Phrase("", contentFont)); qtCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(qtCell); Cell qtValueCell = new Cell(new Phrase( " ", contentFont)); qtValueCell.setHorizontalAlignment(Element.ALIGN_CENTER); qtValueCell.setColspan(5); remarktable.addCell(qtValueCell); } else if ("HHQY".equals(opetype)) { Cell qtCell = new Cell(new Phrase("", contentFont)); qtCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(qtCell); Cell qtValueCell = new Cell( new Phrase(" ", contentFont)); qtValueCell.setHorizontalAlignment(Element.ALIGN_CENTER); qtValueCell.setColspan(5); remarktable.addCell(qtValueCell); qtCell = new Cell(new Phrase("", contentFont)); qtCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(qtCell); qtValueCell = new Cell(new Phrase(" ", contentFont)); qtValueCell.setHorizontalAlignment(Element.ALIGN_CENTER); qtValueCell.setColspan(5); remarktable.addCell(qtValueCell); } } else if ("NZFR".equals(opetype)) { Cell nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setRowspan(2); nzfrCell.setColspan(2); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", tblTitleFont)); nzfrCell.setColspan(6); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("\n", contentFont)); nzfrCell.setRowspan(4); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setColspan(2); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setColspan(3); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setColspan(2); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setColspan(3); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setColspan(2); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setColspan(3); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setColspan(2); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setColspan(3); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); nzfrCell.setColspan(2); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase("", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(nzfrCell); nzfrCell = new Cell(new Phrase(" ", contentFont)); nzfrCell.setHorizontalAlignment(Element.ALIGN_CENTER); nzfrCell.setColspan(2); remarktable.addCell(nzfrCell); } } else if ("FGS".equals(opetype) || "NZYY".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype) || "WGJY".equals(opetype) || "WGDB".equals(opetype) || "HZSFZ".equals(opetype)) { Cell fgsCell = new Cell(new Phrase("/", tblTitleFont)); fgsCell.setColspan(6); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("/", contentFont)); fgsCell.setColspan(2); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("/", contentFont)); fgsCell.setColspan(2); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("/", contentFont)); fgsCell.setColspan(2); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); for (int i = 0; i < 3; i++) { fgsCell = new Cell(""); fgsCell.setColspan(2); remarktable.addCell(fgsCell); fgsCell = new Cell(" "); fgsCell.setColspan(2); remarktable.addCell(fgsCell); fgsCell = new Cell(" "); fgsCell.setColspan(2); remarktable.addCell(fgsCell); } if ("FGS".equals(opetype) || "HZSFZ".equals(opetype)) { fgsCell = new Cell(new Phrase(" ", tblTitleFont)); fgsCell.setColspan(6); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase( " 1; 2;\n 3; 4", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase(" ", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); } else if ("NZYY".equals(opetype)) { fgsCell = new Cell(new Phrase(" ", tblTitleFont)); fgsCell.setColspan(6); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase( " 1; 2;\n 3 3; 4", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell( new Phrase(" ", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase(" ", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase("", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(fgsCell); fgsCell = new Cell(new Phrase(" ", contentFont)); fgsCell.setHorizontalAlignment(Element.ALIGN_LEFT); fgsCell.setColspan(5); remarktable.addCell(fgsCell); } } if ("HHFZ".equals(opetype) || "GRDZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { Cell cell = null; cell = new Cell(new Phrase(" ", tblTitleFont)); cell.setColspan(6); cell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(cell); if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { cell = new Cell(new Phrase( " 1. 2.\n 3. 4. ", contentFont)); } else if ("GRDZ".equals(opetype)) { cell = new Cell(new Phrase( " \n \n \n __________________ ", contentFont)); } cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(5); remarktable.addCell(cell); if ("GRDZ".equals(opetype)) { cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(5); remarktable.addCell(cell); } cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(cell); cell = new Cell(new Phrase(" ", contentFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); cell.setColspan(5); remarktable.addCell(cell); } // Cell sqrTitle = new Cell(new Phrase("", tblTitleFont)); sqrTitle.setColspan(6); sqrTitle.setHorizontalAlignment(Element.ALIGN_CENTER); remarktable.addCell(sqrTitle); String sqrtext = ""; if ("GS".equals(opetype) || "WZGS".equals(opetype)) { sqrtext = "\n \n"; } else if ("FGS".equals(opetype)) { sqrtext = "\n \n"; } else if ("NZFR".equals(opetype)) { sqrtext = "\n \n"; } else if ("NZYY".equals(opetype)) { sqrtext = "\n \n"; } else if ("HHQY".equals(opetype) || "WZHH".equals(opetype)) { sqrtext = "\n \n"; } else if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { sqrtext = "\n \n"; } else if ("GRDZ".equals(opetype)) { sqrtext = "\n \n"; } else if ("WGJY".equals(opetype)) { sqrtext = "\n \n"; } else if ("WGDB".equals(opetype)) { sqrtext = "\n \n"; } else if ("HZS".equals(opetype) || "HZSFZ".equals(opetype)) { sqrtext = "\n \n"; } Paragraph sqrp = new Paragraph(sqrtext, contentFont); String fdbdrname = ""; if ("HHQY".equals(opetype) || "WZHH".equals(opetype)) { fdbdrname = ""; } else if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype)) { fdbdrname = "\n \n "; } else if ("GRDZ".equals(opetype)) { fdbdrname = ""; } else if ("WGJY".equals(opetype) || "WGDB".equals(opetype)) { fdbdrname = ":"; } Paragraph fdbdr = new Paragraph(" " + fdbdrname + " ", contentFont); fdbdr.setFirstLineIndent(40); Paragraph fzrqz = new Paragraph( " " + (("GS".equals(opetype) || "HHQY".equals(opetype) || "WZHH".equals(opetype) || "GRDZ".equals(opetype) || "WZGS".equals(opetype) || "HZS".equals(opetype)) ? "" : "") + " ", contentFont); fzrqz.setFirstLineIndent(40); Cell allCell = new Cell(); allCell.add(sqrp); allCell.add(fdbdr); allCell.add(fzrqz); allCell.setColspan(6); remarktable.addCell(allCell); document.add(remarktable); // if ("GRDZ".equals(opetype)) { Paragraph lerepTitle = new Paragraph("\n", titleChinese); lerepTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(lerepTitle); //TABLE Table lereptable = new Table(4); int lerepwidths[] = { 20, 30, 20, 30 }; lereptable.setWidths(lerepwidths); lereptable.setWidth(100); lereptable.setPadding(3); lereptable.setBorderWidth(1); lereptable.setAlignment(Cell.ALIGN_CENTER); Map<String, String> lerepMap = (Map<String, String>) dataMap.get("lerepMap"); Cell lerep1 = new Cell(new Phrase(" ", contentFont)); lerep1.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep1); Cell lerep2 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("name"), contentFont)); lerep2.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep2); Cell lerep3 = new Cell(new Phrase(" ", contentFont)); lerep3.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep3); Cell lerep4 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("sex"), contentFont)); lerep4.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep4); Cell lerep5 = new Cell(new Phrase("", contentFont)); lerep5.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep5); Cell lerep6 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("natdate"), contentFont)); lerep6.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep6); Cell lerep7 = new Cell(new Phrase(" ", contentFont)); lerep7.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep7); Cell lerep8 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("nation"), contentFont)); lerep8.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep8); Cell lerep9 = new Cell(new Phrase("", contentFont)); lerep9.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep9); Cell lerep10 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("litedeg"), contentFont)); lerep10.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep10); Cell lerep11 = new Cell(new Phrase("", contentFont)); lerep11.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep11); Cell lerep12 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("polstand"), contentFont)); lerep12.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep12); Cell lerep13 = new Cell(new Phrase("", contentFont)); lerep13.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep13); Cell lerep14 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("mobile"), contentFont)); lerep14.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep14); Cell lerep15 = new Cell(new Phrase("", contentFont)); lerep15.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep15); Cell lerep16 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("email"), contentFont)); lerep16.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep16); Cell lerep17 = new Cell(new Phrase("", contentFont)); lerep17.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep17); Cell lerep18 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("certype"), contentFont)); lerep18.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep18); Cell lerep19 = new Cell(new Phrase("", contentFont)); lerep19.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep19); Cell lerep20 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("cerno"), contentFont)); lerep20.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep20); Cell lerep21 = new Cell(new Phrase(" ", contentFont)); lerep21.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep21); Cell lerep22 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("houseadd"), contentFont)); lerep22.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep22); Cell lerep23 = new Cell(new Phrase("", contentFont)); lerep23.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep23); Cell lerep24 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("postalcode"), contentFont)); lerep24.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep24); Cell lerep25 = new Cell(new Phrase("", contentFont)); lerep25.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep25); Cell lerep26 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("occstbeapp"), contentFont)); lerep26.setHorizontalAlignment(Element.ALIGN_CENTER); lerep26.setColspan(3); lereptable.addCell(lerep26); document.add(lereptable); } else if ("WGDB".equals(opetype)) { Paragraph lerepTitle1 = new Paragraph("\n", titleChinese); lerepTitle1.setAlignment(Paragraph.ALIGN_CENTER); document.add(lerepTitle1); Paragraph lerepTitle2 = new Paragraph("/", titleChinese); lerepTitle2.setAlignment(Paragraph.ALIGN_CENTER); document.add(lerepTitle2); //TABLE Table lereptable = new Table(4); int lerepwidths[] = { 20, 30, 20, 30 }; lereptable.setWidths(lerepwidths); lereptable.setWidth(100); lereptable.setPadding(3); lereptable.setBorderWidth(1); lereptable.setAlignment(Cell.ALIGN_CENTER); Map<String, String> lerepMap = (Map<String, String>) dataMap.get("lerepMap"); Cell lerep1 = new Cell(new Phrase("", contentFont)); lerep1.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep1); Cell lerep2 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("entname"), contentFont)); lerep2.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep2); Cell lerep3 = new Cell(new Phrase("", contentFont)); lerep3.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep3); Cell lerep4 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("name"), contentFont)); lerep4.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep4); Cell lerep5 = new Cell(new Phrase("", contentFont)); lerep5.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep5); Cell lerep6 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("position"), contentFont)); lerep6.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep6); Cell lerep7 = new Cell(new Phrase("", contentFont)); lerep7.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep7); Cell lerep8 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("country"), contentFont)); lerep8.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep8); Cell lerep9 = new Cell(new Phrase("", contentFont)); lerep9.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep9); Cell lerep10 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("arrchdate"), contentFont)); lerep10.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep10); Cell lerep11 = new Cell(new Phrase("", contentFont)); lerep11.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep11); Cell lerep12 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("tel"), contentFont)); lerep12.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep12); Cell lerep13 = new Cell(new Phrase("", contentFont)); lerep13.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep13); Cell lerep14 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("certype"), contentFont)); lerep14.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep14); Cell lerep15 = new Cell(new Phrase("", contentFont)); lerep15.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep15); Cell lerep16 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("cerno"), contentFont)); lerep16.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep16); Cell lerep17 = new Cell(new Phrase("", contentFont)); lerep17.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep17); Cell lerep18 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("houaddinchina"), contentFont)); lerep18.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep18); Cell lerep19 = new Cell(new Phrase("", contentFont)); lerep19.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep19); Cell lerep20 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("repdate"), contentFont)); lerep20.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep20); Paragraph rep1 = new Paragraph("", contentFont); rep1.setAlignment(Paragraph.ALIGN_LEFT); Paragraph rep2 = new Paragraph("1", contentFont); rep2.setAlignment(Paragraph.ALIGN_LEFT); Paragraph rep3 = new Paragraph( "25", contentFont); rep3.setAlignment(Paragraph.ALIGN_LEFT); Paragraph rep4 = new Paragraph("3", contentFont); rep4.setAlignment(Paragraph.ALIGN_LEFT); Paragraph rep5 = new Paragraph("/", contentFont); rep5.setAlignment(Paragraph.ALIGN_LEFT); rep5.setIndentationLeft(200); Cell lerep21 = new Cell(); lerep21.add(rep1); lerep21.add(rep2); lerep21.add(rep3); lerep21.add(rep4); lerep21.add(rep5); lerep21.setColspan(4); lereptable.addCell(lerep21); document.add(lereptable); } else { Paragraph lerepTitle = null; if ("GS".equals(opetype) || "NZFR".equals(opetype) || "WZGS".equals(opetype) || "HZS".equals(opetype)) { lerepTitle = new Paragraph("\n", titleChinese); } else if ("FGS".equals(opetype) || "NZYY".equals(opetype) || "HHFZ".equals(opetype) || "GRDZFZ".equals(opetype) || "WZFZ".equals(opetype) || "WZHHFZ".equals(opetype) || "WGJY".equals(opetype) || "HZSFZ".equals(opetype)) { lerepTitle = new Paragraph("\n", titleChinese); } else if ("HHQY".equals(opetype) || "WZHH".equals(opetype)) { lerepTitle = new Paragraph("\n", titleChinese); } lerepTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(lerepTitle); //TABLE Table lereptable = new Table(4); int lerepwidths[] = { 20, 30, 20, 30 }; lereptable.setWidths(lerepwidths); lereptable.setWidth(100); lereptable.setPadding(3); lereptable.setBorderWidth(1); lereptable.setAlignment(Cell.ALIGN_CENTER); Map<String, String> lerepMap = (Map<String, String>) dataMap.get("lerepMap"); Cell lerep1 = new Cell(new Phrase(" ", contentFont)); lerep1.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep1); Cell lerep2 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("name"), contentFont)); lerep2.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep2); Cell lerep3 = new Cell(new Phrase("", contentFont)); lerep3.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep3); Cell lerep4 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("tel"), contentFont)); lerep4.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep4); Cell lerep5 = new Cell(new Phrase("", contentFont)); lerep5.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep5); Cell lerep6 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("mobile"), contentFont)); lerep6.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep6); Cell lerep7 = new Cell(new Phrase("", contentFont)); lerep7.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep7); Cell lerep8 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("email"), contentFont)); lerep8.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep8); Cell lerep9 = new Cell(new Phrase("", contentFont)); lerep9.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep9); Cell lerep10 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("certype"), contentFont)); lerep10.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep10); Cell lerep11 = new Cell(new Phrase("", contentFont)); lerep11.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep11); Cell lerep12 = new Cell(new Phrase(lerepMap == null ? "" : lerepMap.get("cerno"), contentFont)); lerep12.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep12); if ("HHFZ".equals(opetype) || "GRDZFZ".equals(opetype)) { Cell lerep13 = new Cell(new Phrase("", contentFont)); lerep13.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep13); Cell lerep14 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("occstbeapp"), contentFont)); lerep14.setHorizontalAlignment(Element.ALIGN_CENTER); lerep14.setColspan(3); lereptable.addCell(lerep14); } else if ("WZFZ".equals(opetype) || "WZHH".equals(opetype) || "WZHHFZ".equals(opetype) || "WGJY".equals(opetype)) { Cell lerep13 = new Cell(new Phrase("", contentFont)); lerep13.setHorizontalAlignment(Element.ALIGN_CENTER); lereptable.addCell(lerep13); Cell lerep14 = new Cell( new Phrase(lerepMap == null ? "" : lerepMap.get("country"), contentFont)); lerep14.setHorizontalAlignment(Element.ALIGN_CENTER); lerep14.setColspan(3); lereptable.addCell(lerep14); } document.add(lereptable); } if ("HZS".equals(opetype)) { Paragraph hzsp = new Paragraph( "\n ", contentFont); document.add(hzsp); Paragraph hzsp1 = new Paragraph("\n", contentFont); hzsp1.setIndentationLeft(200); document.add(hzsp1); Paragraph hzsp2 = new Paragraph("\n ", contentFont); hzsp2.setAlignment(Paragraph.ALIGN_RIGHT); document.add(hzsp2); } if ("GS".equals(opetype) || "WZGS".equals(opetype)) { //() Paragraph ryxxTitle = new Paragraph("\n", titleChinese); ryxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(ryxxTitle); //TABLE Table ryxxtable = new Table(1); int ryxxwidths[] = { 100 }; ryxxtable.setWidths(ryxxwidths); ryxxtable.setWidth(100); ryxxtable.setPadding(3); ryxxtable.setBorderWidth(1); ryxxtable.setAlignment(Cell.ALIGN_CENTER); List<Map<String, String>> ryxxList = (List<Map<String, String>>) dataMap.get("ryxxList"); if (ryxxList != null && !ryxxList.isEmpty()) { for (int i = 0; i < ryxxList.size(); i++) { Map<String, String> ryxxs = ryxxList.get(i); Paragraph p = new Paragraph(); if ("GS".equals(opetype)) { Phrase p1 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("name")) + " ", contentFont); p.add(p1); Phrase p2 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("position")) + " ", contentFont); p.add(p2); Phrase p3 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("certype")) + " ", contentFont); p.add(p3); Phrase p4 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("cerno")) + " ", contentFont); p.add(p4); } else if ("WZGS".equals(opetype)) { Phrase p1 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("name")) + " ", contentFont); p.add(p1); Phrase p2 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("country")) + " ", contentFont); p.add(p2); Phrase p3 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("certype")) + " ", contentFont); p.add(p3); Phrase p4 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("cerno")) + " ", contentFont); p.add(p4); Phrase p5 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("position")) + " ", contentFont); p.add(p5); Phrase p6 = new Phrase( "" + (ryxxs == null ? "" : ryxxs.get("posbrform")) + " ", contentFont); p.add(p6); } Cell cell = new Cell(p); ryxxtable.addCell(cell); } } document.add(ryxxtable); } if ("GS".equals(opetype)) { //() Paragraph czxxTitle = new Paragraph("\n()", titleChinese); czxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(czxxTitle); //TABLE Table czxxtable = new Table(7); int czxxwidths[] = { 20, 20, 15, 10, 10, 15, 10 }; czxxtable.setWidths(czxxwidths); czxxtable.setWidth(100); czxxtable.setPadding(3); czxxtable.setBorderWidth(1); czxxtable.setAlignment(Cell.ALIGN_CENTER); List<List<String>> czxxList = (List<List<String>>) dataMap.get("czxxList"); if (czxxList != null && !czxxList.isEmpty()) { Cell ct1 = new Cell(new Phrase("\n", contentFont)); ct1.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct1); Cell ct2 = new Cell(new Phrase("", contentFont)); ct2.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct2); Cell ct3 = new Cell(new Phrase("", contentFont)); ct3.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct3); Cell ct4 = new Cell(new Phrase("", contentFont)); ct4.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct4); Cell ct5 = new Cell(new Phrase("", contentFont)); ct5.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct5); Cell ct6 = new Cell(new Phrase("\n", contentFont)); ct6.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct6); Cell ct7 = new Cell(new Phrase("", contentFont)); ct7.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct7); for (int i = 0; i < czxxList.size(); i++) { List<String> czxxs = czxxList.get(i); if (!czxxs.isEmpty()) { for (int j = 0; j < czxxs.size(); j++) { Cell czCell = new Cell(new Phrase(czxxs.get(j), contentFont)); czCell.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(czCell); } } } } document.add(czxxtable); } else if ("WZGS".equals(opetype) || "WZHH".equals(opetype)) { //() Paragraph czxxTitle = new Paragraph("\n/", titleChinese); czxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(czxxTitle); //TABLE int length = 0; int[] czxxwidths = null; if ("WZGS".equals(opetype)) { length = 8; czxxwidths = new int[] { 20, 10, 15, 10, 10, 15, 10, 10 }; } else if ("WZHH".equals(opetype)) { length = 9; czxxwidths = new int[] { 12, 11, 11, 11, 11, 11, 11, 11, 11 }; } Table czxxtable = new Table(length); czxxtable.setWidths(czxxwidths); czxxtable.setWidth(100); czxxtable.setPadding(3); czxxtable.setBorderWidth(1); czxxtable.setAlignment(Cell.ALIGN_CENTER); List<List<String>> czxxList = (List<List<String>>) dataMap.get("czxxList"); if (czxxList != null && !czxxList.isEmpty()) { String ct1text = ""; if ("WZGS".equals(opetype)) { ct1text = "\n"; } else if ("WZHH".equals(opetype)) { ct1text = "\n"; } Cell ct1 = new Cell(new Phrase(ct1text, contentFont)); ct1.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct1); Cell ct11 = new Cell(new Phrase("", contentFont)); ct11.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct11); Cell ct2 = new Cell(new Phrase("", contentFont)); ct2.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct2); Cell ct3 = new Cell(new Phrase("", contentFont)); ct3.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct3); Cell ct31 = new Cell(new Phrase("", contentFont)); ct31.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct31); Cell ct4 = new Cell(new Phrase("", contentFont)); ct4.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct4); Cell ct5 = new Cell(new Phrase("", contentFont)); ct5.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct5); Cell ct6 = new Cell(new Phrase("\n", contentFont)); ct6.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct6); Cell ct7 = new Cell(new Phrase("", contentFont)); ct7.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct7); for (int i = 0; i < czxxList.size(); i++) { List<String> czxxs = czxxList.get(i); if (!czxxs.isEmpty()) { for (int j = 0; j < czxxs.size(); j++) { Cell czCell = new Cell(new Phrase(czxxs.get(j), contentFont)); czCell.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(czCell); } } } } document.add(czxxtable); } else if ("HHQY".equals(opetype)) { // Paragraph czxxTitle = new Paragraph("\n", titleChinese); czxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(czxxTitle); //TABLE Table czxxtable = new Table(9); int czxxwidths[] = { 12, 11, 11, 11, 11, 11, 11, 11, 11 }; czxxtable.setWidths(czxxwidths); czxxtable.setWidth(100); czxxtable.setPadding(3); czxxtable.setBorderWidth(1); czxxtable.setAlignment(Cell.ALIGN_CENTER); List<List<String>> czxxList = (List<List<String>>) dataMap.get("czxxList"); if (czxxList != null && !czxxList.isEmpty()) { Cell ct1 = new Cell(new Phrase("", contentFont)); ct1.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct1); Cell ct2 = new Cell(new Phrase("", contentFont)); ct2.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct2); Cell ct3 = new Cell(new Phrase("", contentFont)); ct3.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct3); Cell ct4 = new Cell(new Phrase("", contentFont)); ct4.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct4); Cell ct5 = new Cell(new Phrase("", contentFont)); ct5.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct5); Cell ct6 = new Cell(new Phrase("", contentFont)); ct6.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct6); Cell ct7 = new Cell(new Phrase("", contentFont)); ct7.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct7); Cell ct8 = new Cell(new Phrase("", contentFont)); ct8.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct8); Cell ct9 = new Cell(new Phrase("", contentFont)); ct9.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct9); for (int i = 0; i < czxxList.size(); i++) { List<String> czxxs = czxxList.get(i); if (!czxxs.isEmpty()) { for (int j = 0; j < czxxs.size(); j++) { Cell czCell = new Cell(new Phrase(czxxs.get(j), contentFont)); czCell.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(czCell); } } } } document.add(czxxtable); } else if ("HZS".equals(opetype)) { // Paragraph czxxTitle = new Paragraph("\n", titleChinese); czxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(czxxTitle); //TABLE Table czxxtable = new Table(5); int czxxwidths[] = { 10, 30, 20, 20, 20 }; czxxtable.setWidths(czxxwidths); czxxtable.setWidth(100); czxxtable.setPadding(3); czxxtable.setBorderWidth(1); czxxtable.setAlignment(Cell.ALIGN_CENTER); List<List<String>> czxxList = (List<List<String>>) dataMap.get("czxxList"); if (czxxList != null && !czxxList.isEmpty()) { Cell ct1 = new Cell(new Phrase("", contentFont)); ct1.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct1); Cell ct2 = new Cell(new Phrase("", contentFont)); ct2.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct2); Cell ct3 = new Cell(new Phrase("", contentFont)); ct3.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct3); Cell ct4 = new Cell(new Phrase("", contentFont)); ct4.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct4); Cell ct5 = new Cell(new Phrase("", contentFont)); ct5.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct5); for (int i = 0; i < czxxList.size(); i++) { List<String> czxxs = czxxList.get(i); if (!czxxs.isEmpty()) { for (int j = 0; j < czxxs.size(); j++) { Cell czCell = new Cell(new Phrase(czxxs.get(j), contentFont)); czCell.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(czCell); } } } } document.add(czxxtable); Paragraph czzep = new Paragraph("\n: " + dataMap.get("regcap") + " () ", contentFont); czzep.setAlignment(Paragraph.ALIGN_LEFT); czzep.setIndentationLeft(100); document.add(czzep); Paragraph czzep1 = new Paragraph("\n ", contentFont); czzep1.setAlignment(Paragraph.ALIGN_LEFT); czzep1.setIndentationLeft(100); document.add(czzep1); Paragraph czzep2 = new Paragraph( "\n ", contentFont); czzep2.setAlignment(Paragraph.ALIGN_RIGHT); document.add(czzep2); } if ("HZS".equals(opetype)) { // Paragraph czxxTitle = new Paragraph("\n", titleChinese); czxxTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(czxxTitle); //TABLE Table czxxtable = new Table(5); int czxxwidths[] = { 10, 20, 30, 25, 15 }; czxxtable.setWidths(czxxwidths); czxxtable.setWidth(100); czxxtable.setPadding(3); czxxtable.setBorderWidth(1); czxxtable.setAlignment(Cell.ALIGN_CENTER); List<List<String>> czxxList = (List<List<String>>) dataMap.get("hzsList"); if (czxxList != null && !czxxList.isEmpty()) { Cell ct1 = new Cell(new Phrase("", contentFont)); ct1.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct1); Cell ct2 = new Cell(new Phrase("", contentFont)); ct2.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct2); Cell ct3 = new Cell(new Phrase("", contentFont)); ct3.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct3); Cell ct4 = new Cell(new Phrase("", contentFont)); ct4.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct4); Cell ct5 = new Cell(new Phrase("", contentFont)); ct5.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(ct5); for (int i = 0; i < czxxList.size(); i++) { List<String> czxxs = czxxList.get(i); if (!czxxs.isEmpty()) { for (int j = 0; j < czxxs.size(); j++) { Cell czCell = new Cell(new Phrase(czxxs.get(j), contentFont)); czCell.setHorizontalAlignment(Element.ALIGN_CENTER); czxxtable.addCell(czCell); } } } } document.add(czxxtable); Paragraph czzep = new Paragraph("\n: " + dataMap.get("cyzs") + " () ", contentFont); czzep.setAlignment(Paragraph.ALIGN_LEFT); czzep.setIndentationLeft(40); document.add(czzep); Paragraph czzep1 = new Paragraph(" " + dataMap.get("nmcy") + " () " + dataMap.get("nmcyrate") + " % ", contentFont); czzep1.setAlignment(Paragraph.ALIGN_LEFT); czzep1.setIndentationLeft(100); document.add(czzep1); Paragraph czzep2 = new Paragraph(" " + dataMap.get("frcy") + " () " + dataMap.get("frcyrate") + " %", contentFont); czzep2.setAlignment(Paragraph.ALIGN_LEFT); czzep2.setIndentationLeft(100); document.add(czzep2); Paragraph czzep3 = new Paragraph( " ", contentFont); czzep3.setAlignment(Paragraph.ALIGN_LEFT); czzep3.setIndentationLeft(40); document.add(czzep3); Paragraph czzep4 = new Paragraph("\n ", contentFont); czzep4.setAlignment(Paragraph.ALIGN_LEFT); czzep4.setIndentationLeft(100); document.add(czzep4); Paragraph czzep5 = new Paragraph( "\n ", contentFont); czzep4.setAlignment(Paragraph.ALIGN_RIGHT); document.add(czzep4); } //() Paragraph cwfzrTitle = new Paragraph("\n", titleChinese); cwfzrTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(cwfzrTitle); //TABLE Table cwfzrtable = new Table(4); int cwfzrwidths[] = { 20, 30, 20, 30 }; cwfzrtable.setWidths(cwfzrwidths); cwfzrtable.setWidth(100); cwfzrtable.setPadding(3); cwfzrtable.setBorderWidth(1); cwfzrtable.setAlignment(Cell.ALIGN_CENTER); Map<String, String> cwfzrMap = (Map<String, String>) dataMap.get("cwfzrMap"); Cell cwfzr1 = new Cell(new Phrase(" ", contentFont)); cwfzr1.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr1); Cell cwfzr2 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("name"), contentFont)); cwfzr2.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr2); Cell cwfzr3 = new Cell(new Phrase("", contentFont)); cwfzr3.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr3); Cell cwfzr4 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("tel"), contentFont)); cwfzr4.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr4); Cell cwfzr5 = new Cell(new Phrase("", contentFont)); cwfzr5.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr5); Cell cwfzr6 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("mobile"), contentFont)); cwfzr6.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr6); Cell cwfzr7 = new Cell(new Phrase("", contentFont)); cwfzr7.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr7); Cell cwfzr8 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("email"), contentFont)); cwfzr8.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr8); Cell cwfzr9 = new Cell(new Phrase("", contentFont)); cwfzr9.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr9); Cell cwfzr10 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("certype"), contentFont)); cwfzr10.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr10); Cell cwfzr11 = new Cell(new Phrase("", contentFont)); cwfzr11.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr11); Cell cwfzr12 = new Cell(new Phrase(cwfzrMap == null ? "" : cwfzrMap.get("cerno"), contentFont)); cwfzr12.setHorizontalAlignment(Element.ALIGN_CENTER); cwfzrtable.addCell(cwfzr12); document.add(cwfzrtable); //() Paragraph llrTitle = new Paragraph("\n", titleChinese); llrTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(llrTitle); //TABLE Table llrtable = new Table(4); int llrwidths[] = { 20, 30, 20, 30 }; llrtable.setWidths(llrwidths); llrtable.setWidth(100); llrtable.setPadding(3); llrtable.setBorderWidth(1); llrtable.setAlignment(Cell.ALIGN_CENTER); Map<String, String> llrMap = (Map<String, String>) dataMap.get("llrMap"); Cell llr1 = new Cell(new Phrase(" ", contentFont)); llr1.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr1); Cell llr2 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("name"), contentFont)); llr2.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr2); Cell llr3 = new Cell(new Phrase("", contentFont)); llr3.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr3); Cell llr4 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("tel"), contentFont)); llr4.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr4); Cell llr5 = new Cell(new Phrase("", contentFont)); llr5.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr5); Cell llr6 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("mobile"), contentFont)); llr6.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr6); Cell llr7 = new Cell(new Phrase("", contentFont)); llr7.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr7); Cell llr8 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("email"), contentFont)); llr8.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr8); Cell llr9 = new Cell(new Phrase("", contentFont)); llr9.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr9); Cell llr10 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("certype"), contentFont)); llr10.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr10); Cell llr11 = new Cell(new Phrase("", contentFont)); llr11.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr11); Cell llr12 = new Cell(new Phrase(llrMap == null ? "" : llrMap.get("cerno"), contentFont)); llr12.setHorizontalAlignment(Element.ALIGN_CENTER); llrtable.addCell(llr12); document.add(llrtable); //() Paragraph wtrTitle = new Paragraph("\n", titleChinese); wtrTitle.setAlignment(Paragraph.ALIGN_CENTER); document.add(wtrTitle); Map<String, String> wtrMap = (Map<String, String>) dataMap.get("wtrMap"); String sqrText = " " + (wtrMap == null ? "" : wtrMap.get("sqr")); Paragraph sqr = new Paragraph(sqrText, contentFont); sqr.setAlignment(Paragraph.ALIGN_LEFT); document.add(sqr); String wtrText = " " + (wtrMap == null ? "" : wtrMap.get("wtr")); Paragraph wtr = new Paragraph(wtrText, contentFont); wtr.setAlignment(Paragraph.ALIGN_LEFT); document.add(wtr); Paragraph wtsx = new Paragraph("\n", contentFont); wtsx.setAlignment(Paragraph.ALIGN_LEFT); document.add(wtsx); String wtText1 = "1 " + (wtrMap == null ? "" : wtrMap.get("entname")) + " "; Paragraph wt1 = new Paragraph(wtText1, contentFont); // wt1.setIndentationLeft(60); document.add(wt1); Paragraph wt2 = new Paragraph(" ", contentFont); // wt2.setIndentationLeft(70); document.add(wt2); Paragraph wt3 = new Paragraph(" __________", contentFont); // wt3.setIndentationLeft(70); document.add(wt3); Paragraph wt4 = new Paragraph("2." + (wtrMap == null ? "" : wtrMap.get("qx1")) + " ", contentFont); // wt4.setIndentationLeft(60); document.add(wt4); Paragraph wt5 = new Paragraph( "3." + (wtrMap == null ? "" : wtrMap.get("qx2")) + " ", contentFont); // wt5.setIndentationLeft(60); document.add(wt5); Paragraph wt6 = new Paragraph( "4." + (wtrMap == null ? "" : wtrMap.get("qx3")) + " ", contentFont); // wt6.setIndentationLeft(60); document.add(wt6); Paragraph wt7 = new Paragraph( "5." + (wtrMap == null ? "" : wtrMap.get("qx4")) + "\n", contentFont); // wt7.setIndentationLeft(60); document.add(wt7); Paragraph wt8 = new Paragraph( " " + (wtrMap == null ? "" : wtrMap.get("confrom")) + " " + (wtrMap == null ? "" : wtrMap.get("conto")) + " \n ", contentFont); wt8.setAlignment(Paragraph.ALIGN_LEFT); document.add(wt8); //TABLE Table wtrtable = new Table(2); int[] wtrwidths = { 50, 50 }; wtrtable.setWidths(wtrwidths); wtrtable.setWidth(100); wtrtable.setPadding(3); wtrtable.setBorderWidth(1); wtrtable.setAlignment(Cell.ALIGN_CENTER); Cell wtrc1 = new Cell(new Phrase("", contentFont)); wtrc1.setRowspan(3); wtrc1.setHorizontalAlignment(Element.ALIGN_CENTER); wtrtable.addCell(wtrc1); Cell wtrc2 = new Cell(new Phrase(" ", contentFont)); wtrc2.setHorizontalAlignment(Element.ALIGN_LEFT); wtrtable.addCell(wtrc2); String telText = "" + (wtrMap == null ? "" : wtrMap.get("tel")); Cell wtrc3 = new Cell(new Phrase(telText, contentFont)); wtrc3.setHorizontalAlignment(Element.ALIGN_LEFT); wtrtable.addCell(wtrc3); String mobileText = "" + (wtrMap == null ? "" : wtrMap.get("mobile")); Cell wtrc4 = new Cell(new Phrase(mobileText, contentFont)); wtrc4.setHorizontalAlignment(Element.ALIGN_LEFT); wtrtable.addCell(wtrc4); document.add(wtrtable); Paragraph wt9 = new Paragraph("\n ", contentFont); wt9.setAlignment(Paragraph.ALIGN_LEFT); document.add(wt9); Paragraph wt10 = new Paragraph("\n" + (wtrMap == null ? "" : wtrMap.get("condate")) + " ", contentFont); wt10.setAlignment(Paragraph.ALIGN_RIGHT); document.add(wt10); // if ("WZGS".equals(opetype) || "WZHH".equals(opetype) || "WGJY".equals(opetype)) { Paragraph wtsTitle1 = new Paragraph("\n", titleChinese); wtsTitle1.setAlignment(Paragraph.ALIGN_CENTER); document.add(wtsTitle1); Paragraph wtsTitle2 = new Paragraph("", titleChinese); wtsTitle2.setAlignment(Paragraph.ALIGN_CENTER); document.add(wtsTitle2); Map<String, String> sdMap = (Map<String, String>) dataMap.get("sdMap"); Paragraph sdsq = new Paragraph(" ", contentFont); sdsq.setAlignment(Paragraph.ALIGN_LEFT); document.add(sdsq); String sdbsqText = " " + (sdMap == null ? "" : sdMap.get("name")); Paragraph sdbsq = new Paragraph(sdbsqText, contentFont); sdbsq.setAlignment(Paragraph.ALIGN_LEFT); document.add(sdbsq); String sqfwText = " " + (sdMap == null ? "" : sdMap.get("name")) + " "; Paragraph sqfw = new Paragraph(sqfwText, contentFont); sqfw.setAlignment(Paragraph.ALIGN_LEFT); document.add(sqfw); Paragraph sqfw2 = new Paragraph( "_______", contentFont); sqfw2.setAlignment(Paragraph.ALIGN_LEFT); sqfw2.setIndentationLeft(60); document.add(sqfw2); //TABLE Table sdstable = new Table(4); int[] sdswidths = { 20, 30, 20, 30 }; sdstable.setWidths(sdswidths); sdstable.setWidth(100); sdstable.setPadding(3); sdstable.setBorderWidth(1); sdstable.setAlignment(Cell.ALIGN_CENTER); Cell sd1 = new Cell(new Phrase("", contentFont)); sd1.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd1); Cell sd2 = new Cell(new Phrase(sdMap == null ? "" : sdMap.get("addr"), contentFont)); sd2.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd2); Cell sd3 = new Cell(new Phrase("", contentFont)); sd3.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd3); Cell sd4 = new Cell(new Phrase(sdMap == null ? "" : sdMap.get("postalcode"), contentFont)); sd4.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd4); Cell sd5 = new Cell(new Phrase("", contentFont)); sd5.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd5); Cell sd6 = new Cell(new Phrase(sdMap == null ? "" : sdMap.get("linkman"), contentFont)); sd6.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd6); Cell sd7 = new Cell(new Phrase("", contentFont)); sd7.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd7); Cell sd8 = new Cell(new Phrase(sdMap == null ? "" : sdMap.get("email"), contentFont)); sd8.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd8); Cell sd9 = new Cell(new Phrase("\n", contentFont)); sd9.setRowspan(2); sd9.setHorizontalAlignment(Element.ALIGN_CENTER); sdstable.addCell(sd9); Cell sd10 = new Cell( new Phrase(" " + (sdMap == null ? "" : sdMap.get("tel")), contentFont)); sd10.setColspan(3); sd10.setHorizontalAlignment(Element.ALIGN_LEFT); sdstable.addCell(sd10); Cell sd11 = new Cell( new Phrase(" " + (sdMap == null ? "" : sdMap.get("mobtel")), contentFont)); sd11.setColspan(3); sd11.setHorizontalAlignment(Element.ALIGN_LEFT); sdstable.addCell(sd11); document.add(sdstable); Paragraph sds1 = new Paragraph( "\n ", contentFont); sds1.setAlignment(Paragraph.ALIGN_LEFT); sds1.setIndentationLeft(100); document.add(sds1); Paragraph sds2 = new Paragraph("\n ", contentFont); sds2.setAlignment(Paragraph.ALIGN_RIGHT); document.add(sds2); Paragraph remark = new Paragraph( " ", contentFont); remark.setIndentationLeft(60); remark.setAlignment(Paragraph.ALIGN_LEFT); document.add(remark); } } } catch (Exception e) { e.printStackTrace(); logger.debug(e); } //PDF document.close(); }
From source file:de.xirp.report.ReportGenerator.java
License:Open Source License
/** * Returns a default formatted/*from w w w.j av a2 s. c om*/ * {@link com.lowagie.text.Paragraph paragraph}. * * @param text * The text for the paragraph. * @param font * The font to use. * @param align * The text alignment. * @return The default formatted paragraph. * @see com.lowagie.text.Paragraph */ private static Paragraph getParagraph(String text, Font font, int align) { Paragraph para = new Paragraph(text, font); para.setFirstLineIndent(0); para.setAlignment(align); return para; }
From source file:EplanPrinter.RTFWrite.java
License:Open Source License
public String addItem(String comment, String category, String group) throws DocumentException, IOException { if (cg.compareTo(group) != 0) { count = 1;//from www . ja v a 2 s. c o m cg = group; cc = category; Font groupContent = new Font(); groupContent.setStyle("bold"); groupContent.setStyle("underline"); groupContent.setSize(12); Paragraph g = new Paragraph(group, groupContent); Font catContent = new Font(); catContent.setSize(12); Paragraph c = new Paragraph(category, catContent); c.setIndentationLeft(30); document.add(g); document.add(c); } else if (cc.compareTo(category) != 0) { count = 1; cc = category; Paragraph c = new Paragraph(category); c.setIndentationLeft(30); document.add(c); } Paragraph p = new Paragraph(); //document.add(p); String test = count + ". " + comment; test = test.replaceAll("<p>", " "); test = test.replaceAll("</p>", " "); if (test.indexOf("<ol>") != -1) { test = test.replaceAll("<ol>", ""); test = test.replaceAll("</ol>", ""); test = test.replaceAll("</li>", "<br />"); int subCount = 1; while (test.indexOf("<li>") != -1) { test = test.replaceFirst("<li>", subCount + ". "); subCount++; } int marker = test.lastIndexOf("<br />"); String sub1 = test.substring(0, marker); String sub2 = test.substring(marker); sub2 = sub2.replaceAll("<br />", ""); test = sub1 + sub2; } if (test.indexOf("<ul>") != -1) { test = test.replaceAll("<ul>", ""); test = test.replaceAll("</ul>", ""); test = test.replaceAll("</li>", "<br />"); int c = 149; char ch = (char) 149; test = test.replaceAll("<li>", "•"); int marker = test.lastIndexOf("<br />"); String sub1 = test.substring(0, marker); String sub2 = test.substring(marker); sub2 = sub2.replaceAll("<br />", ""); test = sub1 + sub2; } StringReader str = new StringReader(test); List<Element> e = HTMLWorker.parseToList(str, null); for (int k = 0; k < e.size(); ++k) { p.add((com.lowagie.text.Element) e.get(k)); } p.setIndentationLeft(40); p.setFirstLineIndent(30); document.add(p); count = count + 1; return ""; }
From source file:org.apache.poi.xwpf.converter.internal.itext.XWPFParagraphUtils.java
License:Open Source License
public static void processLayout(XWPFParagraph paragraph, Paragraph pdfParagraph, XWPFStyle style, CTDocDefaults defaults) {//w w w. ja va2 s .c o m float indentationLeft = -1; float indentationRight = -1; float firstLineIndent = -1; float spacingBefore = -1; float spacingAfter = -1; // 1) From style CTPPr ppr = getPPr(style); if (ppr != null) { // Indentation CTInd ind = ppr.getInd(); if (ind != null) { // Left Indentation BigInteger left = ind.getLeft(); if (left != null) { indentationLeft = dxa2points(left); } // Right Indentation BigInteger right = ind.getRight(); if (right != null) { indentationRight = dxa2points(right); } // First line Indentation BigInteger firstLine = ind.getFirstLine(); if (firstLine != null) { firstLineIndent = dxa2points(firstLine); } } // Spacing CTSpacing spacing = ppr.getSpacing(); if (spacing != null) { // Spacing before BigInteger before = spacing.getBefore(); if (before != null) { spacingBefore = dxa2points(before); } // Spacing after BigInteger after = spacing.getAfter(); if (after != null) { spacingAfter = dxa2points(after); } } // Text aligment CTTextAlignment textAligment = ppr.getTextAlignment(); if (textAligment != null) { // TODO } } // 2) From paragraph if (indentationLeft == -1 && paragraph.getIndentationLeft() != -1) { indentationLeft = dxa2points(paragraph.getIndentationLeft()); } if (indentationRight == -1 && paragraph.getIndentationRight() != -1) { indentationRight = dxa2points(paragraph.getIndentationRight()); } if (firstLineIndent == -1 && paragraph.getIndentationFirstLine() != -1) { firstLineIndent = dxa2points(paragraph.getIndentationFirstLine()); } if (spacingBefore == -1 && paragraph.getSpacingBefore() != -1) { spacingBefore = dxa2points(paragraph.getSpacingBefore()); } if (spacingAfter == -1 && paragraph.getSpacingAfter() != -1) { spacingAfter = dxa2points(paragraph.getSpacingAfter()); } // 3) From default // TODO // Apply if (indentationLeft != -1) { pdfParagraph.setIndentationLeft(indentationLeft); } if (indentationRight != -1) { pdfParagraph.setIndentationRight(indentationRight); } if (firstLineIndent != -1) { pdfParagraph.setFirstLineIndent(firstLineIndent); } if (spacingBefore != -1) { pdfParagraph.setSpacingBefore(spacingBefore); } if (spacingAfter != -1) { pdfParagraph.setSpacingAfter(spacingAfter); } // Aligment ParagraphAlignment alignment = paragraph.getAlignment(); switch (alignment) { case LEFT: pdfParagraph.setAlignment(Paragraph.ALIGN_LEFT); break; case RIGHT: pdfParagraph.setAlignment(Paragraph.ALIGN_RIGHT); break; case CENTER: pdfParagraph.setAlignment(Paragraph.ALIGN_CENTER); break; case BOTH: pdfParagraph.setAlignment(Paragraph.ALIGN_JUSTIFIED); break; } }
From source file:org.pz.platypus.plugin.pdf.PdfOutfile.java
License:Open Source License
/** * Handles indenting the first line of a paragraph. Note: also handles * the [noindent] command, which is a one-time command to not indent the * present paragraph.//www . j a va 2 s . co m * * @param para the paragraph with the indented first line * @param pData the PDF data class containing the indent amount (in points) * @return the amount indented */ float doFirstLineIndent(final Paragraph para, final PdfData pData) { assert (para != null); assert (pData != null); // if noindent = true, skip the indent but reset noident to false, as it is // applicable for only one paragraph before being reset. if (pdfData.getNoIndent()) { pdfData.setNoIndent(false, new Source()); //TODO: get right source? Does it matter? return (0f); } else { float indent = pData.getFirstLineIndent(); para.setFirstLineIndent(indent); return (indent); } }