The Report element is the top-level object that defines the entire report. You must add all content to a report by way of a Section element. Most layout elements use methods to create additional and nested layout elements; this is the same for the Report element, but you can add only one layout element type, the Section element, to the Report element. An easier way to understand this concept would be to visualize it as an object model diagram. For example, a report's layout can be as simple as the following tree:
You can see from the above tree that Sections are the only layout elements you can add to the Report element. Section elements can contain any content element aside from another Section element. Logically, if you can only add a Section element to a Report element, then you would need to be able to add everything to a Section element.
The Report element also has several other properties and methods that are important for report writing. Below is a short list of report features you are likely to use frequently.
The following code will produce a report with the same structure as the tree above. This example does not set any other properties, it only instantiates objects. For example code that shows more detail, see each individual element's help topic for additional information.
In C#:
using Infragistics.Documents.Reports.Report;
using Infragistics.Documents.Reports.Report.Section;
using Infragistics.Documents.Reports.Report.TOC;
using Infragistics.Documents.Reports.Report.Index;
using Infragistics.Documents.Reports.Report.Band;
using Infragistics.Documents.Reports.Report.Flow;
using Infragistics.Documents.Reports.Report.Table;
.
.
.
Report report = new Report();
ISection section1 = report.AddSection();
IGroup group1 = section1.AddGroup();
ISection section2 = report.AddSection();
ITOC tableOfContents = section2.AddTOC();
ISection section3 = report.AddSection();
IReportBand band1 = section3.AddBand();
IFlow flow1 = band1.AddFlow();
ISection section4 = report.AddSection();
ITable table1 = section4.AddTable();
ISection section5 = report.AddSection();
IIndex index1 = section5.AddIndex();
View on GitHub