Esempio n. 1
0
        private ReportEnc GenerateReportData()
        {
            List <Enc> list = new List <Enc>();

            for (int i = 1; i <= ItemsCount; ++i)
            {
                string description = string.Concat(Enumerable.Repeat("Enc Description ", (i % 20) + 1));
                list.Add(
                    new Enc()
                {
                    Name            = $"Enc Name {i}",
                    Description     = $"{description}{i}",
                    ExpiryDate      = DateTime.Now.AddDays(-i),
                    PublicationDate = DateTime.Now.AddDays(-10 - i),
                    Id    = i,
                    Price = i * 10 + i % 3
                });
            }

            ReportEnc re = new ReportEnc()
            {
                CreationDate = DateTime.Now,
                Title        = "AVCS Cells Report",
                Encs         = list
            };

            return(re);
        }
Esempio n. 2
0
        public void CreateReport(string pdfPath)
        {
            string        xslPath = XslPath;
            ReportEnc     re      = GenerateReportData();
            ReportBuilder bld     = new ReportBuilder(re, xslPath);

            bld.HeaderHtmlUrl = HeaderPath;
            bld.HeaderSpacing = 1;
            bld.FooterHtmlUrl = FooterPath;
            bld.FooterSpacing = 1;
            bld.SavePdf(pdfPath);
            Process.Start($"\"{pdfPath}\"");
        }