Grouping data in a Report.rdlc/DataSource

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AndrewBuchan
    New Member
    • Oct 2010
    • 14

    Grouping data in a Report.rdlc/DataSource

    I am running a Stored Procedure which populates a DataTable. The data returned is 8 columns, varying number of rows. One column in the row defines the "Agent" of that row - basically who manages it (my company, our london office, our greek office etc).

    When my report is displayed I want to group the rows by this column, so for example it lists all corresponding rows for "MyCompany" then "London Office" and so on.

    Example:

    MyCompany
    row1value1, row1value2, row1value3
    row2value1, row2value2, row2value3
    row3value1, row3value2, row3value3
    London Office
    row4value1, row4value2, row4value3
    row5value1, row5value2, row5value3
    etc..

    As you can see each "Office" does not have the same amount of rows.

    Currently the output is:

    MyOffice
    row1value1, row1value2, row1value3
    MyOffice
    row2value1, row2value2, row2value3
    MyOffice
    row3value1, row3value2, row3value3

    etc - the column I want to group by is in a repeater row so that is why it behaves as above.

    Any help is greatly appreciated.

    Thanks,
    Andrew

    P.s. Here is how I populate the Report:

    Code:
    dataTable1 = GetData();
    bindingSource1.DataSource = dataTable1;
    report1.RefreshReport();
    If you need any more info please let me know.
Working...