Progress® Telerik® Reporting R3 2017

IDataGroupMemberEnumerateRawData Method

Enumerates all data items (details) that belongs to the current group member.

Namespace:  Telerik.Reporting.Processing
Assembly:  Telerik.Reporting (in Telerik.Reporting.dll)

Syntax

IEnumerable EnumerateRawData()

Return Value

Type: IEnumerable
A set of raw data items that belongs to the current group member.

Examples

The following example, uses the IDataGroupMember.EnumerateRawData() to display the detail items for each member of the Country group.
public class Address
{
    string country;
    string city;

    public string City
    {
        get { return this.city; }
        set { this.city = value; }
    }

    public string Country
    {
        get { return this.country; }
        set { this.country = value; }
    }

    public Address(string country, string city)
    {
        this.country = country;
        this.city = city;
    }
}

public class Report1 : Telerik.Reporting.Report
{
    public Report1()
    {
        this.InitializeComponent();

        this.DataSource = new Address[]
                               {
                                   new Address("UK", "London"),
                                   new Address("USA", "Boston"),
                                   new Address("UK", "Manchester"),
                                   new Address("UK", "Liverpool"),
                                   new Address("USA", "New York"),
                                   new Address("USA", "Houston"),
                                };
    }

    private void InitializeComponent()
    {
        ((System.ComponentModel.ISupportInitialize)this).BeginInit();

        this.detailSection = new Telerik.Reporting.DetailSection();
        this.groupHeaderSection = new Telerik.Reporting.GroupHeaderSection();
        this.groupFooterSection = new Telerik.Reporting.GroupFooterSection();

        this.groupHeaderSection.ItemDataBound += new System.EventHandler(groupHeaderSection_ItemDataBound);

        this.groupFooterSection.ItemDataBound += new System.EventHandler(groupFooterSection_ItemDataBound);

        this.Items.AddRange(new Telerik.Reporting.ReportItemBase[]
                                {
                                    this.groupHeaderSection,
                                    this.detailSection,
                                    this.groupFooterSection,
                                });

        Telerik.Reporting.Group group1 = new Telerik.Reporting.Group();
        group1.Name = "Country";
        group1.GroupHeader = this.groupHeaderSection;
        group1.GroupFooter = this.groupFooterSection;
        group1.Groupings.AddRange(new Telerik.Reporting.Grouping[] { new Telerik.Reporting.Grouping("=Fields.Country"), });

        this.Groups.AddRange(new Telerik.Reporting.Group[] { group1 });

        ((System.ComponentModel.ISupportInitialize)this).EndInit();
    }

    void groupHeaderSection_ItemDataBound(object sender, System.EventArgs e)
    {
        Telerik.Reporting.Processing.GroupSection groupSection = sender as Telerik.Reporting.Processing.GroupSection;
        Telerik.Reporting.Processing.IDataGroupMember dataGroupMember = groupSection.DataObject as Telerik.Reporting.Processing.IDataGroupMember;

        Console.WriteLine("--- Begin '{0}' ---", groupSection.DataObject["Country"]);
        Console.WriteLine("(header)");
        EnumerateGroupMemberRawData(dataGroupMember);
    }

    void groupFooterSection_ItemDataBound(object sender, System.EventArgs e)
    {
        Telerik.Reporting.Processing.GroupSection groupSection = sender as Telerik.Reporting.Processing.GroupSection;
        Telerik.Reporting.Processing.IDataGroupMember dataGroupMember = groupSection.DataObject as Telerik.Reporting.Processing.IDataGroupMember;

        Console.WriteLine("(footer)");
        EnumerateGroupMemberRawData(dataGroupMember);
        Console.WriteLine("--- End '{0}'  ---", groupSection.DataObject["Country"]);
    }

    static void EnumerateGroupMemberRawData(Telerik.Reporting.Processing.IDataGroupMember dataGroupMember)
    {
        foreach (Address address in dataGroupMember.EnumerateRawData())
        {
            Console.WriteLine(string.Format("  {0} - {1}", address.Country, address.City));
        }
    }

    Telerik.Reporting.DetailSection detailSection;
    Telerik.Reporting.GroupHeaderSection groupHeaderSection;
    Telerik.Reporting.GroupFooterSection groupFooterSection;
}

See Also