Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Changing edit options of record item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing edit options of record item

 Post Reply Post Reply
Author
Message
coco View Drop Down
Newbie
Newbie


Joined: 30 June 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote coco Quote  Post ReplyReply Direct Link To This Post Topic: Changing edit options of record item
    Posted: 01 July 2009 at 2:43pm
Hi,
 
I am facing a problem when trying to edit options of record items instead of columns.
The context is: I need to implement a report control with a column of type combo box, but the constraints of the combo boxes will not be the same for all records. For instance, even lines will have a set of constraint and odd lines will have another set of constraints (it was a simplified example).
Hence, I am accessing CXTPReportRecordItemEditOptions from each record instead of accessing it from the column.
 
PS: documentation says that this class represents edit options of the single item or column.
 
However, when I change edit options of a record, it is extended to the whole column.
 
Does anyone know how can I change edit options (setting contraints) of a specific record?
 
This is the code (adapted) in focus:
 
    CXTPReportColumns* pCols = repControl.GetColumns();
    CXTPReportRecords* pRecords = repControl.GetRecords();
    CXTPReportRecordItemEditOptions* pEditOptions;
    CXTPReportColumn* pCol;


    // resetting constraints for dynamic combo box "COLUMN_ID", row by row
    pCol = pCols->GetAt( COLUMN_ID );
    for ( int i = 0; i < pRecords->GetCount(); i++ )
    {
        // clear old constraints
        pRecord = ( MyRecord* )pRecords->GetAt( i );
        pEditOptions = ( pRecord->GetItem( COLUMN_ID ) )->GetEditOptions( pCol );
        pEditOptions->GetConstraints()->RemoveAll();

        // repopulate "id" constraints according to even/odd line
        if ( i % 2 == 0 )
        {
            for ( int i = MIN_PROP_ID; i <= MAX_PROP_ID; i++ )
                pEditOptions->AddConstraint( ToString( i ) );
        }
        else
        {
            for ( int i = MIN_INV_ID; i <= MAX_INV_ID; i++ )
                pEditOptions->AddConstraint( ToString( i ) );
        }
    }
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2
Language: Visual C++ MFC 2003
Back to Top
coco View Drop Down
Newbie
Newbie


Joined: 30 June 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote coco Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 9:03am

I don't know if I was clear. It is a simple feature and I can not implement it in no way. I just must implement a column where different lines shall have different constraints.

 

However, when I try to edit options of a specific record item by CXTPReportRecordItem::GetEditOptions method, it requires me a pColumn parameter:

 

CXTPReportRecordItemEditOptions* GetEditOptions( CXTPReportColumn* pColumn );

 

It seems that the returned value is a pointer to the column edit options.

 

How can I access the edit option of a specific record (not applied to the whole column)?

 
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2
Language: Visual C++ MFC 2003
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2009 at 6:20pm

CXTPReportColumn|

// Retrieves CXTPReportRecordItemEditOptions.

// Returns:

// Edit Options of column

//-----------------------------------------------------------------------

CXTPReportRecordItemEditOptions* GetEditOptions() const;

CXTPReportRecordItemEditOptions* m_pEditOptions; // Edit options of the column

CXTPReportRecordItem

CXTPReportRecordItemEditOptions* m_pEditOptions; // Edit options of the item.

CXTPReportRecordItemEditOptions* CXTPReportRecordItem::GetEditOptions(CXTPReportColumn* pColumn)

{

if (m_pEditOptions)

return m_pEditOptions;

if (pColumn)

return pColumn->GetEditOptions();

return m_pEditOptions = new CXTPReportRecordItemEditOptions();

}

 
so you need to pass NULL instead of pColumn to create individual CXTPReportRecordItem::m_pEditOptions
 
Back to Top
coco View Drop Down
Newbie
Newbie


Joined: 30 June 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote coco Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2009 at 8:17am
Perfect, Doubson!

Thanks a lot.
Product: Xtreme Toolkit Pro version 9.60
Platform: Windows XP (32bit) - SP 2
Language: Visual C++ MFC 2003
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Posted: 15 March 2010 at 5:57pm
I'm trying to achieve something similar, but can't seem to get it to work properly.

I've got basically two lists of constraints to be chosen via a combo box. But it seems that if the first row's combo box has 10 items and the second row's combo has 11 items (and I can see them correctly - 10 and 11), I cannot select the last item in the second row's combo. I still need to investigate this a bit deeper...
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)
Back to Top
Lee Inwoo View Drop Down
Newbie
Newbie


Joined: 31 July 2010
Location: Korea, South
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lee Inwoo Quote  Post ReplyReply Direct Link To This Post Posted: 16 August 2010 at 12:16am
Hi,
Could you show me the sample code more exactly plz?
The code you wrote not work (since I can't understand).
 
My environment info is as follows:
Product: Xtreme Toolkit Pro version 13.4.0
Platform: Windows 7(64bit)
Language: Visual C++ MFC 2008
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.219 seconds.