Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to persist state of ReportCOntrol?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to persist state of ReportCOntrol?

 Post Reply Post Reply
Author
Message
Russ View Drop Down
Groupie
Groupie
Avatar

Joined: 21 September 2003
Location: Russian Federation
Status: Offline
Points: 28
Post Options Post Options   Thanks (0) Thanks(0)   Quote Russ Quote  Post ReplyReply Direct Link To This Post Topic: How to persist state of ReportCOntrol?
    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.   
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
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.043 seconds.