Print Page | Close Window

How to persist state of ReportCOntrol?

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=3461
Printed Date: 09 November 2025 at 9:17pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to persist state of ReportCOntrol?
Posted By: Russ
Subject: How to persist state of ReportCOntrol?
Date Posted: 03 January 2006 at 2:05pm
Hi,

I am trying to do the following: the app has three "screens", they are all unrelated to each other, but user should be able to switch among them.

I use XTP's ShortcutBar to let the user switch views. I dynamically create coresponding views and it works so far so good. The only problem I have is the ReportControl's GroupBy feature. The question: How can I know the current state of ReportControl's GroupBy and how can I programatically restore its state when users needs to look at the view containing Report cOntrol.

Thank you in advance,
Rouslan.   



Replies:
Posted By: sserge
Date Posted: 03 January 2006 at 5:15pm
Hi Rouslan,

Look into the Report Control sample app, method CReportSampleView::OnAutoGrouping(). You can use the similar approach to work with GroupBy items.

1) Saving: iterate all GroupOrder items and save an array of item indexes;
2) Restore the array by adding corresponding columns into the Group Order.


// saving
int nCount =  GetReportCtrl().GetColumns()->GetGroupsOrder()->GetCou nt();
// iterate and save each Item Index:  GetReportCtrl().GetColumns()->GetGroupsOrder()->GetAt( i)->GetItemIndex();


// restoring: iterate saved Item Indexes array:
CXTPReportColumn* pColumn = GetReportCtrl().GetColumns()->Find(SavedIndex(i));
GetReportCtrl().GetColumns()->GetGroupsOrder()->Add(pC olumn);


--
WBR,
Serge



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