Global Project Calendar Excluding Non-Working Days
Details
Date:12/22/2008 5:55:32 AM
Product:ActiveGanttVB Scheduler Component
Framework:Visual Studio 6.0
Version:2.7.3
User's Development Environment:Visual Basic 6.0
Subject:Global Project Calendar
Question

We are unsure how to create a global project calendar so we can set days to exclude from the working period. i.e. Exclude Sat / Sun and public holidays.

Do you have an VB6 or ASP example or a an outline on how to approach this feature.

Answer

Answer:

You can use TimeBlock objects with the GenerateConflict property set to true. This will prevent any task or milestone to be included inside a timeblock.

If you want create a style for the TimeBlock objects:


    ActiveGanttVBCtl1.Styles.Add "TimeBlocks"
    ActiveGanttVBCtl1.Styles.Item("TimeBlocks").Appearance = E_STYLEAPPEARANCE.SA_FLAT
    ActiveGanttVBCtl1.Styles.Item("TimeBlocks").BackColor = RGB(195, 222, 210)
    ActiveGanttVBCtl1.Styles.Item("TimeBlocks").BackgroundPattern = GRE_BACKGROUNDPATTERN.FP_SOLID

Then create the timeblocks themselves:


    ActiveGanttVBCtl1.TimeBlocks.Add NewDate(1, 1, 2009), NewDate(3, 1, 2009), "TB3", "TimeBlocks"
    ActiveGanttVBCtl1.TimeBlocks.Item("TB3").GenerateConflict = True
    ActiveGanttVBCtl1.TimeBlocks.Item("TB3").StartRowIndex = 5
    ActiveGanttVBCtl1.TimeBlocks.Item("TB3").EndRowIndex = 7

StartRowIndex and EndRowIndex can be set as follows to cover the entire schedule:


    ActiveGanttVBCtl1.TimeBlocks.Item("TB1").StartRowIndex = 1
    ActiveGanttVBCtl1.TimeBlocks.Item("TB1").EndRowIndex = ActiveGanttVBCtl1.Rows.Count

 

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.