예제 #1
0
        public FlatPDFReport(string reportTitle, IEnumerable <T> data,
                             string subtitle = null, string destinationFile = null, PDFReportSettings settings = null)
            : base(reportTitle, data, subtitle, ReportFormat.Text, destinationFile)
        {
            _settings = settings ?? new PDFReportSettings(reportTitle, subtitle);

            _document = new Document(_settings.PageSize, _settings.MarginLeft, _settings.MarginRight, _settings.MarginTop, _settings.MarginBottom);

            _pdfWriter = PdfWriter.GetInstance(_document, new FileStream(DestinationFile, FileMode.Create));

            _pdfWriter.PageEvent = new PDFReportPageEventHandler(_settings);

            _document.Open();

            Write();
        }
예제 #2
0
        static PDFReportSettings()
        {
            Default = new PDFReportSettings();

            Default.ReportTitle         = "Report";
            Default.ReportSubtitle      = null;
            Default.IsGroupedReport     = false;
            Default.Logo                = TryGetLogoFromConfigurationFile();
            Default.PageNumberContainer = TryGetPageNumberContainerImageFromConfigurationFile();
            Default.PageSize            = iTextSharp.text.PageSize.A4;
            Default.MarginLeft          = 40f;
            Default.MarginRight         = 80f;
            Default.MarginTop           = 100f;
            Default.MarginBottom        = 80f;

            Default.ReportTitleFont     = SetFont(FontNames.SegoeUILight, 22f, 85, 100, 226);
            Default.ReportSubTitleFont  = SetFont(FontNames.SegoeUILight, 14f, 255, 255, 255, FontStyle.Italic);
            Default.ReportFooterFont    = SetFont(FontNames.SegoeUILight, 11f, 245, 5, 53);
            Default.ReportTimestampFont = SetFont(FontNames.SegoeUILight, 10f, 128, 128, 128);
        }
 public PDFReportPageEventHandler(PDFReportSettings settings = null)
 {
     _settings = settings ?? PDFReportSettings.Default;
 }
 public VideoActivityGroupedByVideoPDFReport(string reportTitle,
                                             IEnumerable <IGrouping <string, EmailAndCompletionPercentage> > data,
                                             string subtitle = null, string destinationFile = null, PDFReportSettings settings = null)
     : base(reportTitle, data, subtitle, destinationFile, settings)
 {
 }