Skip to main content

Grouping within a report

Comments

2 comments

  • Permanently deleted user

    Hi Chris,

    I don't know of a way to do this outside of ActiveReports scripting.  However, a single line should take care of it for you:

      rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "ZONE");

    On the script tab in Report Designer, choose DataInitialize from the "Event" dropdown menu, then paste the line above in between the curly braces.  Change "ZONE" to match the name of the Zone field in your data.  Note you can also specify ascending or descending, or you can include multiple columns (if you are doing multi-level grouping) by using something like this:

      rpt.DataSource = ((DataSet)rpt.DataSource).Tables[0].Select(null, "ZONE, OWNERNAME ASC");

    The null value passed in as the first parameter to the Select method is the query, which you likely don't need to supply.  Also for the curious, the main report always takes the first table in the DataSet, which is why the index 0 is coded in to the script line.

    Let me know if this works for you.

    John

    0
  • Chris Dunlop

    Thanks John, that's just what I was looking for!  I'll be able to make some very useful summary reports based on this.

     

    Chris
    0

Please sign in to leave a comment.