05-12-2016 09:24 AM
How to access object collections e.g. ReportSections from Report object? I can access ReportSection but not its collection...
Reference: http://www.ni.com/pdf/manuals/372844e.pdf
Solved! Go to Solution.
05-17-2016 08:53 AM
Maybe you don't understand exactly what report section is. According to the help:
Use objects of this class to store, update, and transfer reports. You typically use ReportSection objects to avoid creating copies of a report as the report is transferred between the report generator, process models, Report object, and ReportView control. You can create a new ReportSection object by calling the Report.NewReportSection method. ReportSection objects can contain other ReportSection objects.
Typically, a process model creates and updates the ReportSection object and assigns it to the Report object by setting the Report.ReportSection property.
It does have a subproperty called ReportSubsections which specifies a reference to the ReportSections object, which is a collection that contains a list of child ReportSection objects to the current object. Looking at this object, it's a list of items that you can index through to get each.
"I won't be wronged. I won't be insulted. I won't be laid a-hand on. I don't do these things to other people, and I require the same from them." John Bernard Books
05-17-2016 03:29 PM - edited 05-17-2016 03:30 PM
You were right I did not understand it, but i think now i got it 🙂
. Report /*Report associated with particular Execution*/ . AsReport /*Report interface*/ . ReportSection.ReportSubsections.Item(/*item index*/) . /*Report section*/ ReportSubsections /*Subsection of report section*/.
If I understand correctly, each Report object consist of hierarchical sections, which can be freely nested. So e.g. for some execution I can have a report. This report can have seperate section for header, footer and body. This sections form ReportSections collection and can be accessed with ReportSection.ReportSubsections.Item(/*item index*/). Furthermore e.g. body section can have seperate section for each result.
Moreover each ReportSection object has its content devided in header, body and footer string, but it is just string not subsection per se.