colinxjcallahan

Generating reports with multiple pages

Discussion created by colinxjcallahan on Dec 8, 2013
Could someone show me an example of how to generate a report with multiple pages? Currently I'm only getting one page that says "Page 1 of 5". Here's my code:

        string GenerateReport(string templateLocation, esriReportExportType reportExportType, string filename)
        {
            IReportDataSource report = new ReportClass();
            report.Layer = CollisionViewExtension.FeatureLayer;

            ((IReportTemplate) report).LoadReportTemplate(templateLocation);
            var reportEngine = ((IReportEngine) report);
            var runReportSuccess = reportEngine.RunReport(null);

            var s = reportExportType.ToString();
            var extension = "." + s.Substring(s.Length - 3, 3);
            var fileName = filename.Contains(extension)
                               ? filename
                               : filename + extension;

            var exportReportSuccess = reportEngine.ExportReport(fileName, "1", reportExportType);

            return fileName;
        }

Thanks in advance.

Outcomes