public void CreatePdf_MasterDetailDatasetFromStream_ValidPdfFile()
        {
            var dataset = CreateMasterDetailDataset();
            var report = new ReportFromStreamDefinitionFacade(dataset, File.ReadAllBytes("Reports\\MasterDetailSample\\Template.rdlc"));

            report.SubReports.Add(new SubReportFromStreamDefinitionFacade(File.ReadAllBytes("Reports\\MasterDetailSample\\Template_Detail.rdlc"), "Template_Detail"));
            var file = Reports.Generator.CreateFile(report);

            SaveFile(file, "MasterDetailDatasetFromStream.pdf");
        }
예제 #2
0
        public static byte[] CreateFile(ReportFromStreamDefinitionFacade report, FileTypes ouputType = FileTypes.PDF)
        {
            var localReport = GetNewLocalReport(report.ReportDataSet);
            localReport.LoadReportDefinition(report.Definition);

            foreach (var subReport in report.SubReports)
            {
                localReport.LoadSubreportDefinition(subReport.Name, subReport.Definition);
            }

            return localReport.Render(ouputType.ToString());
        }
        public void CreatePdf_SampleReportViaStreamDefinition_ValidPdfFile()
        {
            var dataset = CreateSample1Dataset();
            var reportDefinition = new ReportFromStreamDefinitionFacade(dataset, File.ReadAllBytes("Reports\\Sample1\\Template.rdlc"));
            var file = Reports.Generator.CreateFile(reportDefinition);

            SaveFile(file, "SimpleDataSetViaStreamDefinition.pdf");
        }