Print Page | Close Window

CreateEventEx & multischedule

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=21577
Printed Date: 28 April 2024 at 3:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CreateEventEx & multischedule
Posted By: ma_cip
Subject: CreateEventEx & multischedule
Date Posted: 10 April 2013 at 3:48am
Hi, I am evaluating Codejock Xtreme Calendar ActiveX in a MsAccess Application.

I need to load a Custom Data Provider (Recordset filtered).

Using CreateEventEx, (as suggested in http://www.codejock.com/support/articles/com/calendar/cp_3.asp) it works fine.

Anyway I'm not able to load events grouped in a multischedule layout (Users/Events)

This is the code used.
***
...
...
Dim thisEvent As CalendarEvent
dim MyCalendar As new CalendarControl
Dim g_DataResourcesMan  As New CalendarResourcesManager
Dim pData As CalendarDataProvider
Dim pSchedules As CalendarSchedules
Dim pRCDesc As CalendarResourceDescription

Set MyCalendar = Me.CalendarControl0.Object
Set pData = MyCalendar.DataProvider
Set pSchedules = pData.Schedules
 
pSchedules.AddNewSchedule ("xxx")
pSchedules.item(0).ID = 1
pSchedules.AddNewSchedule ("yyy")
pSchedules.item(1).ID = 2
If pSchedules Is Nothing Or pSchedules.count = 0 Then exit Sub
   
Dim Btsched As Byte
For Btsched = 0 To pSchedules.count - 1
g_DataResourcesMan.AddResource pSchedules(Btsched).name, True
Next i

Set thisEV = MyCalendar.DataProvider.CreateEventEx(99)
thisEV.StartTime = CDate(Now)
thisEV.body= "Event1"
....
....
thisEV.ScheduleID = 2
pData.AddEvent thisEV

Set thisEV = MyCalendar.DataProvider.CreateEventEx(100)
thisEV.StartTime = CDate(Now+1)
thisEV.body= "Event2"
....
....
thisEV.ScheduleID = 1
pData.AddEvent thisEV
...
...
MyCalendar.DataProvider.AddEvent thisEV

For i = 0 To g_DataResourcesMan.ResourcesCount - 1
    Set pRCDesc = g_DataResourcesMan.Resource(i)
        pRCDesc.Resource.SetDataProvider pData, false
            pRCDesc.Resource.ScheduleIDs.Add pSchedules(i).ID
                pRCDesc.GenerateName = True
Next i

g_DataResourcesMan.ApplyToCalendar MyCalendar

***

And the calendar appears blank, while not using multischedule option, it's correttly pupulated.

Has anyone any suggestion/trick ?
I need to solve this problem before the purchase of the control.

Thanks.



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