当前位置: 首页>>代码示例>>C#>>正文


C# LocalReport.LoadSubreportDefinition方法代码示例

本文整理汇总了C#中LocalReport.LoadSubreportDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# LocalReport.LoadSubreportDefinition方法的具体用法?C# LocalReport.LoadSubreportDefinition怎么用?C# LocalReport.LoadSubreportDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LocalReport的用法示例。


在下文中一共展示了LocalReport.LoadSubreportDefinition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadSubReport

 // Reports Load
 public static void LoadSubReport(LocalReport rpt, string reportName, string reportPath)
 {
     rpt.LoadSubreportDefinition(reportName, File.OpenRead(reportPath));
 }
开发者ID:taigum,项目名称:ssrs-non-native-functions,代码行数:5,代码来源:reportHelper.cs

示例2: Generate

        public void Generate(Models.ReportModel reportModel, string destinationPath)
        {
            using (LocalReport localReport = new LocalReport())
            {
                localReport.DataSources.Add(new ReportDataSource("DataSet1", reportModel.MidYearReportData));

                Func<string, System.IO.FileStream> openReadOnlyStream =
                    (file) => System.IO.File.Open(file, System.IO.FileMode.Open, System.IO.FileAccess.Read);

                localReport.LoadSubreportDefinition("StatsChart",
                    System.IO.StringReader.Synchronized(new System.IO.StreamReader(this.definitions.StatsChartPath)));

                localReport.LoadSubreportDefinition("CognitiveReportsUnlocked",
                    System.IO.StringReader.Synchronized(new System.IO.StreamReader(this.definitions.CognitiveReportsUnlockedPath)));

                localReport.LoadSubreportDefinition("StudentsOnTrack",
                    System.IO.StringReader.Synchronized(new System.IO.StreamReader(this.definitions.StudentsOnTrackPath)));

                localReport.LoadSubreportDefinition("CognitiveWeaknesses",
                    System.IO.StringReader.Synchronized(new System.IO.StreamReader(this.definitions.CognitiveWeaknessesPath)));

                localReport.LoadSubreportDefinition("LeadingCohorts",
                    System.IO.StringReader.Synchronized(new System.IO.StreamReader(this.definitions.LeadingCohortsPath)));

                SubreportProcessingEventHandler processSubreport = (s, e) =>
                {
                    if (e.ReportPath == "StatsChart")
                    {
                        e.DataSources.Add(new ReportDataSource("DataSet1", reportModel.BasicStats));
                    }
                    if (e.ReportPath == "CognitiveReportsUnlocked")
                    {
                        e.DataSources.Add(new ReportDataSource("DataSet1", reportModel.UnlockedReports));
                    }

                    if (e.ReportPath == "StudentsOnTrack")
                    {
                        e.DataSources.Add(new ReportDataSource("DataSet1", reportModel.OnTrack));
                    }

                    if (e.ReportPath == "CognitiveWeaknesses")
                    {
                        e.DataSources.Add(new ReportDataSource("DataSet1", reportModel.CognitiveWeakness));
                    }

                    if (e.ReportPath == "LeadingCohorts")
                    {
                        e.DataSources.Add(new ReportDataSource("DataSet1", reportModel.LeadingCohorts));
                    }
                };

                localReport.SubreportProcessing += processSubreport;
                localReport.ReportPath = this.definitions.MidYearReportPath;

                byte[] completedReport = localReport.Render("PDF");

                using (var writer = new System.IO.FileStream(destinationPath, System.IO.FileMode.Create))
                {
                    writer.Write(completedReport, 0, completedReport.Count());
                }
                localReport.SubreportProcessing -= processSubreport;

            }

        }
开发者ID:jcwrequests,项目名称:C8AccountStatusReview,代码行数:65,代码来源:MidYearSchoolReport.cs


注:本文中的LocalReport.LoadSubreportDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。