Print Page | Close Window

CXTPReportControl Request

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=974
Printed Date: 06 November 2025 at 9:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl Request
Posted By: Italo
Subject: CXTPReportControl Request
Date 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.




Replies:
Posted By: hunter
Date Posted: 27 July 2004 at 2:05pm

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



Posted By: Italo
Date Posted: 28 July 2004 at 10:56am
Thanks, but I was hoping to be able to serialize it to a string (maybe XML).


Posted By: spike
Date 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.


Posted By: Ark42
Date Posted: 30 July 2004 at 9:24am
Window positions are just a binary WINDOWPOS  struct saved to the registry, not strings or xml.



Posted By: spike
Date Posted: 30 July 2004 at 3:27pm

What is your point?



Posted By: Ark42
Date 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.



Posted By: spike
Date 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.


Posted By: Oleg
Date 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



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