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

CXTPReportControl Request

 Post Reply Post Reply
Author
Message
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Topic: CXTPReportControl Request
    Posted: 23 July 2004 at 8:12pm

It would be great if the control had a function to safe the current layout (columns index, sort order, grouped columns, etc) to a string.

Thanks, Italo.

Back to Top
hunter View Drop Down
Newbie
Newbie


Joined: 27 July 2004
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote hunter Quote  Post ReplyReply Direct Link To This Post Posted: 27 July 2004 at 2:05pm

There are methods to Serialize config (check XTPReportControl.h)

Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 28 July 2004 at 10:56am
Thanks, but I was hoping to be able to serialize it to a string (maybe XML).
Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2004 at 8:39am
Yea, I dont understand why they didnt stick with *their* standard of saving to an XML file or registry or whatever, like docking panes or window positions.
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2004 at 9:24am
Window positions are just a binary WINDOWPOS  struct saved to the registry, not strings or xml.

Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2004 at 3:27pm

What is your point?

Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 30 July 2004 at 10:24pm

Point was "Yea, I dont understand why they didnt stick with *their* standard of saving to an XML file or registry or whatever, like docking panes or window positions." when the only thing that really applies to is docking pane layouts as far as I can tell.  Every other thing I have saved to the registry via codejock is a binary structure as far as I have seen.

Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2004 at 6:34pm
They may be in binary, but they atleast give you the option to save to the registry or XML already built in. I dont see why they didnt add the same functionality to this control.
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 August 2004 at 3:48am

void CReportSampleView::LoadReportState()
{
 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;
}

void CReportSampleView::SaveReportState()
{
 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); 

}

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.031 seconds.