Hi,
I am working on report generation from custom templates using ArcGIS Pro SDK. I have created a custom template .rptt file and added that template in some path. I have added attributes table data in the Page Header and Details section of the custom template. Also I have added some data in the Report Header. Now using below code I am trying to generate the report:
var reportTemplates = await ReportTemplateManager.GetCustomTemplatesAsync(templatePath);
var reportTemplate = reportTemplates.First(r => r.Name == templateName);
var reportFields = new List<CIMReportField>(); // added all the fields in this list.
var reportDataSource = new ReportDataSource(mapMember, "", false, reportFields);
var report = ReportFactory.Instance.CreateReport(reportName, reportDataSource, null, null, reportTemplate, "");
var mainReportSection = report.Elements.OfType<ReportSection>().FirstOrDefault();
var reportHeader = mainReportSection.Elements.OfType<ReportHeader>().FirstOrDefault();
reportHeader.Elements // data is removed here, not able to see data that was defined or added in the ReportHeader of custom template.
Now the problem is ReportHeader section defined in my custom template is getting removed.
But if I am using ArcGIS Pro report tool to generate the report from that custom template, it is retaining the ReportHeader content of the custom template.
It seems that Pro’s report API is not even using the custom template but creating a report from scratch.
My MapMember is a standalone table.
Any problem in the above SDK code?
@GKmieliauskas @Wolf @UmaHarano @NarelleChedzey @CharlesMacleod