Print Page | Close Window

Changing edit options of record item

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14664
Printed Date: 17 June 2025 at 6:50am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Changing edit options of record item
Posted By: coco
Subject: Changing edit options of record item
Date 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



Replies:
Posted By: coco
Date 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


Posted By: mdoubson
Date 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
 


-------------
Mark Doubson, Ph.D.


Posted By: coco
Date 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


Posted By: dennisV
Date 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)


Posted By: Lee Inwoo
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net