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 General Discussion » RowInsert problem in CExtReportGridWnd Collapse All
Subject Author Date
ven rag Oct 4, 2006 - 7:57 AM

Hi ppl..

I am using CExtReportGridWnd class...I am Trying to insert a Row in CExtReportGridWnd in side a "for loop"
Iam getting a Abort error..
int m_row=htinfo.m_nRowNo ;
for(i=1;i<=Count;i++)
{
                
                hTreeItem = m_wndGrid.ItemGetByVisibleRowIndex( htinfo.m_nRowNo );
                pRGI = m_wndGrid.ReportItemFromTreeItem( hTreeItem );
                pRGC = m_wndGrid.ReportColumnGet( _T("sno"), _T("test"));
                ASSERT_VALID( pRGC );
                pCell =m_wndGrid.ReportItemGetCell( pRGC, pRGI );
                ASSERT_VALID( pCell ); //ASSERT_KINDOF( CExtGridCellNumber, pCell );
                pCell->TextSet(s);
m_wndGrid.RowInsert(m_row);//Abort Error.........
m_row++;
            
}

How to Solve this Problem and also How to display CExtReportGridWnd in the "Tree Format Style" in the begining of the Application..
ie to make the CExtReportGridWnd in the format of Tree in InitDialog itself..

Thank u

Technical Support Oct 4, 2006 - 9:52 AM

You should not use the CExtGridWnd::RowInsert() method with the CExtReportGridWnd window. Just use one of the CExtReportGridWnd::ReportItemRegister() overloaded methods instead:

    virtual bool ReportItemRegister(
        CTypedPtrArray < CPtrArray, CExtReportGridItem * > & arrRegisteredItems,
        bool bUpdateSortOrder = false,
        bool bRedraw = false
        );
    CExtReportGridItem * ReportItemRegister(
        bool bUpdateSortOrder = false,
        bool bRedraw = false
        );
You should setup the sort order information to the report grid window if you want to see the report items (rows) sorted and/or grouped. This should be done by invoking the CExtReportGridWnd::ReportSortOrderSet() method and you will need to initialize the CExtReportGridSortOrder object to describe how the report items should be sorted and/or grouped.

ven rag Oct 5, 2006 - 9:47 AM

I have tried out ReportitemRegister() function.The Row gets inserted but I have a problem here ...???????

In the CExtReportGridItem u can Set it in the Form of Tree also...
Suppose I have the Following Column in CExtReportGridItem

Name Studid Marks

A 101 100
90
70
B 102 90
80
45
in Tree Format
-Name
- Studid
-Marks

(ie) we have
-Name:A
-Studi:101
-Marks:100
90
70
After arranging in Tree it has to be in the above format..........But in the "Marks" Column the values 100,90,70 (the value that is got in for loop)
is not Set under the corresponding Student.....The Row that I have inserted is Separated from the Sequence that I want to derive...

ie I get the Result in this format...
-Name:A
Studid:101
-Marks:

The Marks values is empty and the Values(100,90,70..) is Added in the Separate row ...The marks (100,90,70) should be the Child of Marks Column when I expand the Tree.....
To say it simple way..When I double Click the Name "A" the Studentid "101" as to be inserted as the Child of Name "A" and When I double Click
Studid "101" rows as to be inserted and Marks (100,90,70.......)as to child of Studid "101".

How to solve this problem ..Please give a
sample to insert a Row in such a way that the value of the parent and child are ok....
thank u.



Technical Support Oct 5, 2006 - 10:08 AM

If you insert one or more new report items (rows), please update the report grid’s sort order by invoking the CExtReportGridWnd::ReportSortOrderUpdate() method.