Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Report control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report control

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

Joined: 18 May 2005
Location: Denmark
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote JGranborg Quote  Post ReplyReply Direct Link To This Post Topic: Report control
    Posted: 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
Back to Top
bevpet View Drop Down
Newbie
Newbie
Avatar

Joined: 01 April 2005
Location: Canada
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote bevpet Quote  Post ReplyReply Direct Link To This Post 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_STATE

CXTPPropExchangeXMLNode 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_STATE

CXTPPropExchangeXMLNode 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

 

Back to Top
JGranborg View Drop Down
Newbie
Newbie
Avatar

Joined: 18 May 2005
Location: Denmark
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote JGranborg Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2005 at 1:42pm
Thanks a lot great input
Jørgen Granborg
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.047 seconds.