protected override void GenerateSignatures() { if (this.isSignatureShown) { document.NewPage(); float sectionMargin = 10f; float cellVerticalPadding = 4f; this.document.Add(PdfElementGenerator.createSectionTitleParagraph("Electronic Signatures")); PdfPTable signatureTable = PdfElementGenerator.createTable(new float[] { 0.05f, 0.95f }, false, false); for (int i = 0; i < this.signatureList.Count; i++) { PdfPCell[] newRowCells = PdfElementGenerator.AddEmptyRowToTable(signatureTable, true); newRowCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase((i + 1).ToString()); newRowCells[1].Phrase = PdfElementGenerator.createTableCellContentPhrase(this.signatureList[i].ToString(Common.GlobalProfile.DateTimeFormator)); newRowCells[0].HorizontalAlignment = Element.ALIGN_CENTER; foreach (var item in newRowCells) { item.PaddingTop = cellVerticalPadding; item.PaddingBottom = cellVerticalPadding; } } this.document.Add(PdfElementGenerator.createSectionFrameTable(signatureTable, false, true)); this.rowsInfectedBySignature = (int)((30 + signatureTable.TotalHeight + sectionMargin * 3) / this.dataListContentCellHeight); PdfElementGenerator.AddEmptyParagraphToDocument(this.document, this.sectionMargin); } }
protected override void GenerateLoggingSummary() { this.document.Add(PdfElementGenerator.createSectionTitleParagraph("Logging Summary")); IDictionary <string, string[]> loggingSummaryContents = this.reportdataGenerator.GetLoggingSummaryColumsContents(this.device, this.deviceDataFrom); string[] column1Contents = loggingSummaryContents["column1Contents"]; string[] column2Contents = loggingSummaryContents["column2Contents"]; PdfPTable loggingSummaryTable = PdfElementGenerator.createTable(new float[2] { 0.5f, 0.5f }); PdfPCell[] firstRowCells = loggingSummaryTable.Rows[0].GetCells(); firstRowCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase(column1Contents[0] + "\n\r" + column1Contents[1] + "\n\r" + column1Contents[2] + "\n\r" + column1Contents[3] + "\n\r" + column1Contents[4]); firstRowCells[1].Phrase = PdfElementGenerator.createTableCellContentPhrase(column2Contents[0] + "\n\r" + column2Contents[1] + "\n\r" + column2Contents[2] + "\n\r" + column2Contents[3] + "\n\r" + column2Contents[4]); this.document.Add(PdfElementGenerator.createSectionFrameTable(loggingSummaryTable)); PdfElementGenerator.AddEmptyParagraphToDocument(this.document, this.sectionMargin); }
protected override void GenerateComments() { string finalCommentString = string.Empty; if (this.CurrentComment != ReportConstString.CommentDefaultString) { finalCommentString = this.CurrentComment; } this.document.Add(PdfElementGenerator.createSectionTitleParagraph("Comments")); PdfPTable commentTable = PdfElementGenerator.createTable(new float[] { 1f }); PdfPCell[] firstRowCells = commentTable.Rows[0].GetCells(); firstRowCells[0].Phrase = PdfElementGenerator.createTableCellContentPhrase(finalCommentString); firstRowCells[0].FixedHeight = 25f; this.document.Add(PdfElementGenerator.createSectionFrameTable(commentTable)); }
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); }