/// <summary> /// Gets the section type for a report component /// </summary> /// <param name="definition">The report definition</param> /// <param name="componentName">The component name</param> /// <returns>The section type</returns> private ReportSectionType GetSectionType ( ReportDefinition definition, string componentName ) { var allSectionTypes = Enum.GetValues ( typeof(ReportSectionType) ); foreach (ReportSectionType sectionType in allSectionTypes) { var component = definition.FindComponent ( sectionType, componentName ); if (component != null) { return(sectionType); } } return(ReportSectionType.ReportBody); }