Example #1
0
        private static void Test04(string repPath, List <Process> processes)
        {
            //try
            //{

            var outputfile  = $"..\\..\\TestResults\\{nameof(Test04)}.OnDemandRenderingButIgnoreCorrection.pdf";
            var localReport = new LocalReport();

            localReport.ShowDetailedSubreportMessages = true;

            localReport.LoadReport(repPath, ReportCorrectionMode.HmFontsCorrection);

            var report = ReportsLoader.ExportToFile(localReport, new ReportSettings()
            {
                OutputType = ReportingServiceOutputFileFormat.PDF, IgnorePersianCorrection = true
            });

            File.WriteAllBytes(outputfile, report);

            Console.WriteLine($"Report {nameof(Test04)} Generated! (and will be opened in a second...)");
            processes.Add(System.Diagnostics.Process.Start(outputfile));

            //}
            //catch (Exception x)
            //{
            //    throw;
            //}
        }
Example #2
0
        private static void Test03(string inputReportFile, string inputSubReportFile, List <Process> processes)
        {
            var outputReportFileBaseName = $"..\\..\\TestResults\\{nameof(Test03)}.PersianRenderer";

            var correctedFileDefinition          = outputReportFileBaseName + ".rdlc";
            var correctedSubReportFileDefinition = outputReportFileBaseName + ".SubReport.rdlc";
            var correctedFileOutput = outputReportFileBaseName + ".pdf";


            PersianRenderer.CorrectReportDefinition(inputReportFile, correctedFileDefinition);
            PersianRenderer.CorrectReportDefinition(inputSubReportFile, correctedSubReportFileDefinition);

            var localReport = new LocalReport();

            localReport.ShowDetailedSubreportMessages = true;

            localReport.LoadReport(correctedFileDefinition, ReportCorrectionMode.None);

            var textReader = File.OpenText(correctedSubReportFileDefinition);

            localReport.LoadSubreportDefinition("Subreport1", textReader);          //I dont' know why it doesn't work

            var report = ReportsLoader.ExportToFile(localReport, new ReportSettings()
            {
                OutputType = ReportingServiceOutputFileFormat.PDF
            });

            File.WriteAllBytes(correctedFileOutput, report);

            Console.WriteLine($"Report {nameof(Test03)} Generated! (and will be opened in a second...)");
            processes.Add(System.Diagnostics.Process.Start(correctedFileOutput));
        }
Example #3
0
        private static void Test05(string repPath, List <Process> processes)
        {
            var outputfile  = $"..\\..\\TestResults\\{nameof(Test05)}.IngoreCorrectionFromScratch.pdf";
            var localReport = new LocalReport();

            localReport.ShowDetailedSubreportMessages = true;
            localReport.LoadReport(repPath, ReportCorrectionMode.None);

            var report = ReportsLoader.ExportToFile(localReport, new ReportSettings()
            {
                OutputType = ReportingServiceOutputFileFormat.PDF
            });

            File.WriteAllBytes(outputfile, report);

            Console.WriteLine($"Report {nameof(Test05)} Generated! (and will be opened in a second...)");
            processes.Add(System.Diagnostics.Process.Start(outputfile));
        }