![]() |
Report control |
Post Reply
|
| Author | |
JGranborg
Newbie
Joined: 18 May 2005 Location: Denmark Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Topic: Report controlPosted: 18 May 2005 at 10:50am |
|
I like to save the state of the report control when the user leaves it or alternative Start with som grouping based on one of the columns Does any of the examples give some help.
|
|
|
Jørgen Granborg
|
|
![]() |
|
bevpet
Newbie
Joined: 01 April 2005 Location: Canada Status: Offline Points: 39 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 May 2005 at 1:39pm |
|
look at the report grid same, it has the functions to save/restore the state of a reportbar. (...\Codejock Software\MFC\Xtreme Toolkit Pro\Samples\ReportControl\ReportSample) void CReportSampleView::LoadReportState(){ #ifdef XML_STATECXTPPropExchangeXMLNode px(TRUE, 0, _T("ReportControl")); if (!px.LoadFromFile(_T("c:\\ReportControl.xml"))) return; m_wndReport.DoPropExchange(&px); #else UINT nBytes = 0; LPBYTE pData = 0; if (!AfxGetApp()->GetProfileBinary(_T("ReportControl"), _T("State"), &pData, &nBytes)) return; CMemFile memFile(pData, nBytes); CArchive ar (&memFile,CArchive::load); try { m_wndReport.SerializeState(ar); } catch (COleException* pEx) { pEx->Delete (); } catch (CArchiveException* pEx) { pEx->Delete (); } ar.Close(); memFile.Close(); delete[] pData; #endif } void CReportSampleView::SaveReportState(){ #ifdef XML_STATECXTPPropExchangeXMLNode px(FALSE, 0, _T("ReportControl")); m_wndReport.DoPropExchange(&px); px.SaveToFile(_T("c:\\ReportControl.xml")); #else CMemFile memFile; CArchive ar (&memFile,CArchive::store); m_wndReport.SerializeState(ar); ar.Flush(); DWORD nBytes = (DWORD)memFile.GetPosition(); LPBYTE pData = memFile.Detach(); AfxGetApp()->WriteProfileBinary(_T("ReportControl"), _T("State"), pData, nBytes); ar.Close(); memFile.Close(); free(pData); #endif } HTH Peter
|
|
![]() |
|
JGranborg
Newbie
Joined: 18 May 2005 Location: Denmark Status: Offline Points: 4 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 May 2005 at 1:42pm |
|
Thanks a lot great input
|
|
|
Jørgen Granborg
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |