Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - Dataset
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Dataset

 Post Reply Post Reply
Author
Message
zaksoft View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Topic: Dataset
    Posted: 26 April 2007 at 6:47am
I need to show (not to edit - just show and print) in a calendar view the sum of a couple XML recordset.
 
Imagine that the company produce the recordset of company events, the R&D department have it's own scheduled meeting and John Smith use a calendar element to store it's own apps.
 
What I need is to merge all this recorset (and maybe national holidays) to print a full view.
 
This allows users to have a big picture without loading all repetitive dates.
 
The top goal is if in a future version some of this recordset can be read-only and the user can edit it's own recordset having all other information shown.
 
Any help (maybe a different approach to solve the problem) will be appreciated.
 
VS2022 - MFC MBCS Statically linked

XTP 23.1 Static Link

---------------------------------------------------------

Davide Zaccanti - ZakSoft - www.zaksoft.com

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

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2007 at 1:21am
Any suggestion ?
 
VS2022 - MFC MBCS Statically linked

XTP 23.1 Static Link

---------------------------------------------------------

Davide Zaccanti - ZakSoft - www.zaksoft.com

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

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2007 at 6:47pm
Your idea sounds similar to the one I've been implementing.

My approach was to construct a filter of event records that are keyed to each "participant".  The events of interest per participant are then easy to isolate.

I built an "appointment" table which contains the participant information in records which is then keyed to the calendarEvent eventID. It's a similar approach to how the recurring events are handled.

This seemed to be the most appropriate method to me since I am working with an SQL database engine where I could add my custom tables without much trouble.

I believe you could also try using the "CustomPropertiesXMLData" field as well without adding a table if you didn't have too many other columns to add. If you had a lot of different "participants" it would slow things down considerably as you would have to parse that field every time you wanted to filter the records.

Where I've been having trouble is exactly how to get only the filtered events displayed in the calendar. The system seems to want to reload all the records each time I change a participant filter which I am trying to avoid.  I tried finding a "collection" of the events for the calendar so I could perhaps isolate the records that way and selectively remove the ones that were filtered out from the display. I haven't found anything like that yet though and received no responses to my inquiry on this message board. My hunch is that there isn't one which could make this problematic. The lack of a collection does sort of make sense as you would only load the records that were "in demand" and not have them all in memory all the time. I'll probably end up making my own array of eventID's as the records are loading and work from that.

One other thing you could try is modifying the "multi-schedule" system. It does selective events, but what seems to me in a very inefficient manner.. by setting up different entire databases for each participant or group. For that reason (and the absence of SQL support) I didn't find it of any use.

I hope this gives you some ideas and you can work something out. I'd be interested in hearing your solution.

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

Joined: 05 June 2003
Location: Italy
Status: Offline
Points: 162
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaksoft Quote  Post ReplyReply Direct Link To This Post Posted: 09 May 2007 at 5:14am
Thanks for your suggestions.
 
My idea is to explore two different approach:
 
1) Sql Server tables like the ones used by CJ, and we can insert filter fields, the problem is if how and wen filters were applied (something like report filtering can be a solution, but I think this must be done by CJ)
2) Sql Server table with XML chunk of data, all records selected are read and XMLs merged
 
Both requires at present a complete reload of all instances and this is a very disappointing aspect regardless program speed.
 
I'll keep everyone interested updated.
VS2022 - MFC MBCS Statically linked

XTP 23.1 Static Link

---------------------------------------------------------

Davide Zaccanti - ZakSoft - www.zaksoft.com

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: 12 May 2007 at 7:59am
Gents,

For me it looks like a native solution for this problem in Calendar control is to use Schedules collection.

Isn't it ease to use? You need just a few typical operations:
1) Set an Id for an event:
NewEvent.ScheduleID = CalendarControl.DataProvider.Schedules(0).Id

2) Setup your view to show only events with particular schedules:
    ...
    Dim pRes As New CalendarResource
    ...
    pRes.ScheduleIDs.Add YourID1 ' and all which you'd like
    ...

Call Populate and that's it! For a future you will only need to modify pRes.ScheduleIDs collection when needed to hide/show some another appointments bunch.

--
WBR,
Serge
Back to Top
Algae View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 January 2007
Location: United States
Status: Offline
Points: 217
Post Options Post Options   Thanks (0) Thanks(0)   Quote Algae Quote  Post ReplyReply Direct Link To This Post Posted: 12 May 2007 at 2:06pm
Thank you for the reply Sserge.

I did try the schedule system and while it appears to have been carefully designed with great built-in flexibility there were some critical capabilities that it didn't have that I required. Maybe I didn't grasp all the parts of the system and it truly would be a solution but I was never able to adapt it to my needs.

In order to illustrate the problem I had with it, consider the following scenario:

Jane, Jack, and John all work for the same company. Jack's job is to schedule meetings for Jane and John. The data therefore has to be available to Jane, John and Jack, but in different configurations.

Jack would obviously require access to all event records.. which is the default display and no problem.

Jane and John may be scheduled for the same meeting.. or not.  At times their schedules intersect, at other times they don't. A single schedule ID that Jane and John "shared" would not suffice since it can't be both exclusive and inclusive.  You would have to store a duplicate Event for each event that intersects, each with it's own "unique to user" schedule ID.

For a single point data source such as a master SQL data provider that can be a problem with respect to keyed records. Not to mention a lot of extra work for Jack who would have to create the duplicate records with the exception of a single schedule ID.

The more attendees, the more duplicate records. It was simpler to associate "participant" records with each event. Each event is then linked to the participant records by the event ID. It becomes a much simpler process to add or remove attendees without replicating or removing events from separate schedules.

I hope this makes sense. If you have additional suggestions or I've made some incorrect assumptions, please feel free to let me know.



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: 14 May 2007 at 6:03pm
Hmmm.... This sounds pretty wise. Why we haven't implemented that from the beginning?  Will try to recall...

--
WBR,
Serge
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: 15 May 2007 at 3:50pm
Well, there could be possible a following workaround for now: you will create a form for such events which will contain an event properties and participants lists. When user press OK on the form you create a separate event for each participant.

Event has a custom properties collection:
-- You may store EventIDs which were created for other participants in custom properties;
-- So far each event could have a reference to other events in a group;
-- This allows you to get all group by one event, or synchronously change other related events in a group if one event is changed;

It's a bit complex and overhead in code, but that will work for a current version. Until we will implement a collection of schedules for an event...

--
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.188 seconds.