Print Page | Close Window

DoPropExchange error

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=6784
Printed Date: 17 June 2024 at 3:50pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: DoPropExchange error
Posted By: roychr
Subject: DoPropExchange error
Date Posted: 02 April 2007 at 3:36pm
There is an error that slips in when the control loads back values from a file : After rebuilding my columns i do a DoPropExchange to set back user saved columns layout. Then the report does not seems to have any redraw message anymore. My report control is a sub-class of CXTPReportControl and is embedded into a sub-class of CXTPReportView. Why does the view not redraw itself properly after the doPropExchange is beyond me. When i scroll from left to Right the bounding for selection is not redrawed and stops at the last displayed column before the scrolling. The selection line spawns full line, and elements in all the cells seems to be redrawed with a bit of distortion. Columns have events enabled after scrolling beyond the former display zone, but no selection or click item event happens afterwards in the region after last column of the former displayed view.
 
i have the following coe for saving :
 
all my routines are in the Sub-classed report view but are only affecting the report-control inside it.
 
CCftpo6PositionReportView::OnReportViewLoadXmlColumnsConfig(CAsstBaseReportControl& Report)
{
CCftpo6XmlConfiguration* configXml = CCftpo6StaticObjects::GetXmlConfiguration();
if(configXml->Load())
{
CRuntimeClass* prt = this->GetRuntimeClass();
 
//Get section from xml
CXTPPropExchangeSection pxReportControl(configXml->GetPropertyExchangeNode()->GetSection(_T(prt->m_lpszClassName)));
 
//load from file (call original DoPropExchange, not overriden)
Report.DoPropExchange(&pxReportControl);
}
}
 
CCftpo6PositionReportView::OnReportVideSaveXmlColumnsConfig(CAsstBaseReportControl& Report)
{
CCftpo6XmlConfiguration* configXml = CCftpo6StaticObjects::GetXmlConfiguration();
 
configXml->PrepareToSave();
 
CRuntimeClass* prt = this->GetRuntimeClass();
 
//Get section from xml
CXTPPropExchangeSection pxReportControl(configXml->GetPropertyExchangeNode()->GetSection(_T(prt->m_lpszClassName)));
 
pxReportControl->EmptySection();
 
Report.DoPropertyExchange(&pxReportControl);
 
configXml->Save();
configXml->ReleaseFile();
}
 
my content of my xml file (cftpo6App.config)
 
...
<CCftpo6PositionReportView>
<Columns>
<Column ItemIndex="0"
               Alignment="2"
               AutoWidth="100/>
...this goes on up to my last column...
<Column ItemIndex="28"
               Alignment="1"
               AutoWidth="100"/>
</Columns>
</CCftpo6PositionReportView>
...
 
The question remains that since i do not use CXTPReportControl with CXTPReportView, is there problems that can rise by subclassing both and adding functionality to them ? I did not change any of the base implementations of DoPropExchange for both objects, but the DoPropExchange of the View is not called, i call my own save/load functions. The Save/Load Function works well throughout the application, i am pretty sure there is some member values that are resetted that should not. Please look into it, we really need this to work.
 
Christian Roy
Senior System Analyst
Land Software Engineering Center
Canada



Replies:
Posted By: roychr
Date Posted: 02 April 2007 at 3:42pm
Please note that i am using version 10.3 of codejock with MFC under visual studio 2005 with service pack 1.



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