protected override void GenerateDeviceConfigurationAndTripInfomation() { PdfPTable generalTable = PdfElementGenerator.createTable(new float[] { 0.49f, 0.02f, 0.49f }); PdfPCell[] firstRowCells = generalTable.Rows[0].GetCells(); // 生成两个版块的标题 firstRowCells[0].Phrase = PdfElementGenerator.createSectionTitlePhrase("Device Configuration"); PdfPTable tripInfoTitleTable = PdfElementGenerator.createTable(new float[2] { 0.4f, 0.6f }, false, false); PdfPCell[] tripInfoTitleRowCells = PdfElementGenerator.AddEmptyRowToTable(tripInfoTitleTable, false, false); tripInfoTitleRowCells[0].Phrase = PdfElementGenerator.createSectionTitlePhrase("Trip Information"); tripInfoTitleRowCells[1].Phrase = PdfElementGenerator.createTableCellContentPhrase(reportdataGenerator.GetLocalTimeZoneString()); tripInfoTitleRowCells[1].HorizontalAlignment = Element.ALIGN_RIGHT; firstRowCells[2] = new PdfPCell(tripInfoTitleTable); firstRowCells[2].Border = 0; firstRowCells[0].PaddingBottom = 4f; firstRowCells[2].PaddingBottom = 4f; //PdfElementGenerator.AddEmptyRowToTable(generalTable); // 填充Device Configuration的内容 IDictionary <string, string[]> deviceConfigurationContents = this.reportdataGenerator.GetDeviceConfigurationTripInfoRowsContents(this.device); string[] row1Contents = deviceConfigurationContents["row1Contents"]; string[] row2Contents = deviceConfigurationContents["row2Contents"]; string[] row3Contents = deviceConfigurationContents["row3Contents"]; string[] tripInfoContents = deviceConfigurationContents["tripInfoContents"]; PdfPTable deviceConfigTable = PdfElementGenerator.createTable(new float[] { 0.42f, 0.58f }); PdfPCell[] deviceRowCells = deviceConfigTable.Rows[0].GetCells(); deviceRowCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase(row1Contents[0] + "\n\r" + row2Contents[0] + "\n\r" + row3Contents[0]); deviceRowCells[1].Phrase = PdfElementGenerator.createTableCellContentPhrase(row1Contents[1] + "\n\r" + row2Contents[1] + "\n\r" + row3Contents[1]); // 填充Trip Information的内容 PdfPTable tripInfoTable = PdfElementGenerator.createTable(new float[] { 0.185f, 0.815f }); IList <PdfPCell> tripInfoCells = tripInfoTable.Rows[0].GetCells(); tripInfoCells[0].Colspan = 2; tripInfoCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase("Trip Number: " + tripInfoContents[0]); PdfPCell[] descriptionRowCells = PdfElementGenerator.AddEmptyRowToTable(tripInfoTable, false, true, false); descriptionRowCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase(tripInfoContents[1].Trim()); descriptionRowCells[1].Phrase = PdfElementGenerator.createTableCellContentPhrase(tripInfoContents[2]); descriptionRowCells[0].PaddingTop = 6f; descriptionRowCells[1].PaddingTop = 6f; PdfPCell[] sencondRowCells = PdfElementGenerator.AddEmptyRowToTable(generalTable, false); sencondRowCells[0] = new PdfPCell(PdfElementGenerator.createSectionFrameTable(deviceConfigTable, false, false)); sencondRowCells[2] = new PdfPCell(PdfElementGenerator.createSectionFrameTable(tripInfoTable, false, false)); document.Add(generalTable); PdfElementGenerator.AddEmptyParagraphToDocument(this.document, this.sectionMargin); }