/// <summary> /// Creates an report object with the passed data. /// </summary> /// <returns>Returns a Report object.</returns> public Report Report() { SetupStyles(); SetupReportInfo("Document Exporter"); IBand reportHeader = section.AddBand(); IText reportHeaderText = reportHeader.AddText(); reportHeaderText.Height = new FixedHeight(30); reportHeaderText.Style.Font = headerFont; if (this.exportAllPages) { reportHeaderText.AddContent("Congratulations! You have exported all pages from the report successfully!"); } else { reportHeaderText.AddContent(string.Format("Congratulations! You have exported page {0} successfully!", this.currentPageNumber)); } ITable table = section.AddTable(); table.Borders = bordersStyle; table.Margins.Top = 5; table.Margins.Bottom = 5; table.Width = new RelativeWidth(100); table.Margins.Left = 30; // Header ITableHeader header = table.Header; header.Height = new FixedHeight(24); header.Repeat = true; this.AddHeaderCell(header, "Order ID"); this.AddHeaderCell(header, "Contact Name"); this.AddHeaderCell(header, "Shipping Address"); this.AddHeaderCell(header, "Order Date"); //Here we add all the rows of the table this.AddTableRows(table); return(report); }