Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - DoPropExchange error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DoPropExchange error

 Post Reply Post Reply
Author
Message
roychr View Drop Down
Newbie
Newbie
Avatar

Joined: 06 December 2006
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote roychr Quote  Post ReplyReply Direct Link To This Post Topic: DoPropExchange error
    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
Back to Top
roychr View Drop Down
Newbie
Newbie
Avatar

Joined: 06 December 2006
Location: Canada
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote roychr Quote  Post ReplyReply Direct Link To This Post 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.
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.172 seconds.