Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Grouped Records
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Grouped Records

 Post Reply Post Reply
Author
Message
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Topic: Grouped Records
    Posted: 27 April 2009 at 4:32pm
Does anyone know of a good method to create a combined record based on grouped columns?

For instance, records (rows) are grouped on column 1 and 2:

Col 1
______
         | Col 2
         |______


         Col 1 | Col 2 | Col 3 | Col 4
         -------------------------------
Row 1|   A    |   B    |    C   |   D
--------------------------------------
Row 2|   A    |   B    |    E    |   F


a) I want to create a new record when any Rows are grouped.
Example when: (Row 1, Col 1) == (Row 2, Col 1) && (Row 1, Col 2) == (Row 2, Col 2).
My method of finding the first grouped row is pretty convoluted where I have to test all the columns against the ordered column list and so on. Making a new record based on the found row is a simple process of copying the found row record to a new record.

The result should be: New Record (A, B, C, D)

b) Now I want to append whatever doesn't match from Record 2 to this new record!

The result should be New Record (A, B, C, D, E, F)

It seems like it should be simple, but I've really ended up with quite a mess trying to get the collection of rows under the same "grouped by" column(s). Is there an easy method to grab all the rows under a Grouping? Digging through the code I've found the CXTPReportColumnOrder which gives me the ordered column list, but nothing to indicate which rows or records are indeed Grouped.

Thanks in advance for any tips on how to accomplish this.


Back to Top
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Posted: 29 April 2009 at 1:42pm
Ok.. I'll simplify my question:

Is there a method to get the grouped rows (or records) under a group row? The group row being the one with the +/- box. 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.