Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Group/Sort in CExtReportGridWnd Collapse All
Subject Author Date
Alexander Kool Nov 21, 2006 - 4:39 AM

hey,
i’ve got 2 questions about CExtReportGridWnd

1. How can I get my columns grouped the moment when I start my application without doing it myself. I want 2 columns grouped. I tried to use the code in OnRgColumnCtxCmdGroupByContextField, it worked partially. 2 columns are set in the GroupArea but they aren’t grouped yet. As soon as is sort a column (doesn’t matter which column, also columns outside the grouparea). the 2 columns in the GroupArea are grouped.

is there another way to group columns at the start of the running of my application. if not how can I be sure the columns are grouped right away.

2. Is it possible to have a function besides, Sort Ascending and Sort Desending, like UnSort. That the cells get their original state of position back. if so, how can i do that?

Alexander Kool Nov 29, 2006 - 2:09 AM

thanks for your support.

I got it now. I just realized it when I saw my previous message.

I called the function ’ReportSortOrderUpdate’ right after the columns were created. but than the columns didn’t have anything to sort, so its logical they didn’t appaer in tree form.

so when I called that function after the cells were created it worked fine.

Alexander Kool Nov 27, 2006 - 6:04 AM

How can I change the gridcell state then?, I can change the griditem state but not the cell.

I want to correct myself: It isn’t the column that is in a form of a tree but the cells IN the column.

for example i’ve got 2 columns named ’section’ and ’side’ both containing information then my result should is(in tree form).

- Section: And
.... + Side: Left
.... + Side: Right
.... + Side: Top
.... + Side: Bottom

- Section: PWR
.... + Side: Left
.... + Side: Right
.... + Side: Top
.... + Side: Bottom

I’ve got this result already and it is OK but now I want to run my program with the above right at the start.

Technical Support Nov 28, 2006 - 11:42 AM

When initializing the grid, please try

ReportGridModifyStyle( __ERGS_COLLAPSE_AFTER_REGROUPING, 0, false );

Alexander Kool Nov 27, 2006 - 3:52 AM

I’m sorry if I expressed myself wrong because I don’t think you understood what I meant.

I do want sorting for grouped columns and I do want those columns first followed by the rest of the data.

The only thing I want is that my first two columns are in a form of a tree. That’s bassicaly all.

for example if I drag one column to the grouparea my datagrid will become in form of a tree. thats what I want as soon as I start my program without dragging the columns myself. I accomplished to move the columns to the grouparea so the only thing I want more is that they are in a from of tree.






Suhai Gyorgy Nov 27, 2006 - 4:25 AM

My guess is that you want to make the tree items initially expanded. I could’t find an easy solution for that, what might work is setting all gridcell’s state to __EEBS_EXPANDED, but it seems unfairly big work.

Alexander Kool Nov 22, 2006 - 2:30 AM

thanks for your help.
i replaced your code with mine and it worked. But I still got the same problem that the the 2 columns are in the grouparea, but aren’t grouped in form of a tree.
I mean I have to sort one of the columns first and only then the columns are in form of a tree.
eventualy I don’t want to show the grouparea. So I want to skip the part to sort first (because if the GroupArea isn’t visible the columns aren’t in the grid and it looks like they disappeared) and have the form of a tree right away. How can I do that?

Jordi Hoogeweegen

Technical Support Nov 23, 2006 - 10:20 AM

It is hardly possible to implement high performance row grouping without sorting by grouped columns. Both the CExtReportGridWnd window and supergrid window in MS Outlook sort data by grouped columns first and only then optionally sort data by several additional columns. It is essential. We could implement such a feature but this would significantly slow down the performance. So we think it is unreasonable.

Technical Support Nov 21, 2006 - 11:33 AM

You should specify a sort order information object for the report grid control. Here is the sample code:

CExtReportGridWnd & wndReportGrid = . . .
 
    // grouping by two columns
CExtReportGridColumn * pRGC1 = . . .
CExtReportGridColumn * pRGC2 = . . . 
bool bAscending1 = . . .
bool bAscending2 = . . .
CExtReportGridSortOrder rgso;
    rgso.ColumnInsert( pRGC1, -1, bAscending1 ); 
    rgso.ColumnInsert( pRGC2, -1, bAscending2 );
    rgso.ColumnGroupCountSet( 2 );
    wndReportGrid.ReportSortOrderSet( rgso, false, true );
 
    // removing sort order
CExtReportGridSortOrder rgsoEmpty;
    wndReportGrid.ReportSortOrderSet( rgsoEmpty, false, true );
rgsoEmpty is empty and has no columns, so it specifies that there should not be any sorting/grouping.