Summary:
This example illustrates using the SaveHTMLHyperlinkDrillDown method to publish a hierarchy of schedules. Here is how it works:
|
Sub htmldrilldown() Dim fs As Object,objmilestonesmain As Object Dim mydocfolder As String, newfoldername As String Dim connectortype As Integer, symboltype1 As Integer, symboltype2 As Integer, thedate As String, taskname As String Dim objproject, tasks, T As Object, filename As String Dim objmilestonessub(6) As Object ' 1. A folder (tempmiles) is created in user's my documents folder 'Create a temporary object objmilestonestemp = CreateObject("Milestones") On Error GoTo folderexists mydocfolder = .getmydocumentsfolder()
End With
folderexists: '2. Create 5 separate project schedules For x = 1 To 5 objmilestonessub(x) = CreateObject("Milestones") With objmilestonessub(x) .Activate() .use20columns() 'symbol 1 will be a lime inverted triangle .settoolboxsymbolproperty(1, "Type", 1) .settoolboxsymbolproperty(1, "FillColor", RGB(0, 255, 0)) 'green 'symbol 2 will be a red triangle .settoolboxsymbolproperty(2, "Type", 2) .settoolboxsymbolproperty(2, "FillColor", RGB(255, 0, 0)) 'red 'symbols 3 and 4 will be black stars .settoolboxsymbolproperty(3, "Type", 5) .settoolboxsymbolproperty(3, "FillColor", RGB(0, 0, 0)) 'rgb (0,0,0) 'black .settoolboxsymbolproperty(4, "Type", 5) .settoolboxsymbolproperty(4, "FillColor", RGB(0, 0, 0)) 'rgb (0,0,0) 'black 'symbols 5 and 6 will be blue squares .settoolboxsymbolproperty(5, "Type", 6) .settoolboxsymbolproperty(5, "FillColor", RGB(255, 0, 0)) 'red .settoolboxsymbolproperty(6, "Type", 6) .settoolboxsymbolproperty(4, "FillColor", RGB(0, 0, 255)) 'blue 'symbol 7 will be a yellow 5-sided triangle .settoolboxsymbolproperty(7, "Type", 40) .settoolboxsymbolproperty(7, "FillColor", RGB(0, 0, 255)) 'symbol 8 will be a down pointing 5-sided triangle .settoolboxsymbolproperty(8, "Type", 41) .settoolboxsymbolproperty(8, "FillColor", RGB(0, 0, 255)) 'symbols 9 and 10 will be green octagons .settoolboxsymbolproperty(9, "Type", 56) .settoolboxsymbolproperty(9, "FillColor", RGB(0, 128, 0)) .settoolboxsymbolproperty(10, "Type", 56) .settoolboxsymbolproperty(10, "FillColor", RGB(0, 128, 0)) 'set up one connector in the toolbox .settoolboxhorizontalconnectorproperty(1, "Type", 7) .SetFrameAndBackgroundOptions(2, 0, RGB(0, 0, 0), RGB(128, 255, 255), RGB(255, 255, 128), 2, 1, 1) .setcolumnproperty(1, "TextAlign", 1) .setcolumnproperty(2, "TextAlign", 1) .setcolumnwidth(1, 2.4) .setcolumnwidth(2, 1.5) .setcolumnproperty(2, "SmartColumn", "duration") .setcolumnproperty(1, "ColumnHeadingLine1", "Project " + Str(x)) .setcolumnproperty(1, "ColumnHeadingLine2", "Tasks") .setcolumnproperty(2, "ColumnHeadingLine1", "Duration") .setfontstyle(12, 1, 18) .setfontstyle(6, 1, 18) .setfontstyle(13, 1, 18) .setfontstyle(3, 1, 24) .setfontstyle(4, 1, 24) For X2 = 1 To 10 .settoolboxsymbolproperty(X2, "DatePosition", 13) Next X2 .SetEndDate("11/15/2019") .SetStartDate("06/01/2019") For tasks = 1 To 5 taskname = "Project " + Str(x) + " Task: " + Str(tasks) .putcell(tasks, 1, taskname) symboltype1 = tasks * 2 - 1 symboltype2 = tasks * 2 connectortype = 1 thedate = Trim(Str(tasks + 5)) + "/15/2019" .addtaskusingduration(tasks, thedate, symboltype1, connectortype, 0, symboltype2, 12 + tasks, "Day") .setsymbolproperty(tasks, 1, "SymbolDatePosition", 2) .setsymbolproperty(tasks, 2, "SymbolDatePosition", 3) .setsymbolproperty(tasks, 1, "DateBack", "transparent") .setsymbolproperty(tasks, 2, "DateBack", "transparent") .setsymbolproperty(tasks, 1, "TextBack", "transparent") .setsymbolproperty(tasks, 2, "TextBack", "transparent") Next tasks .SetTitle1("Project " + Str(x)) .SetTitle2("DrillDown Example") .SetTitle3("Note: dummy dates used for this example!") .setlinesperpage(5) filename = newfoldername + "\project" + Trim(Str(x)) + ".MLP" .save(filename) .Close() End With Next x 'next schedule '3. make the top level schedule objmilestonesmain = CreateObject("Milestones") With objmilestonesmain 'Start Milestones .Activate() .SetFrameAndBackgroundOptions(2, 0, RGB(0, 0, 0), RGB(255, 255, 128), RGB(255, 255, 255), 3, 0, 1) .setstartandenddates("06/01/2022","11/15/2022")
'4. Add one task for each project to the top level schedule. .putcell(1, 1, "Project 1") .putcell(2, 1, "Project 2") .putcell(3, 1, "Project 3") .putcell(4, 1, "Project 4") .putcell(5, 1, "Project 5") .setlinesperpage(5) .addtaskusingduration(1, "6/15/2022", 1, 1, 0, 2, 10, "Day") .addtaskusingduration(2, "7/15/2022", 1, 1, 0, 2, 10, "Day") .addtaskusingduration(3, "8/15/2022", 1, 1, 0, 2, 10, "Day") .addtaskusingduration(4, "9/15/2022", 1, 1, 0, 2, 10, "Day") .addtaskusingduration(5, "10/15/2022", 1, 1, 0, 2, 10, "Day") For x = 1 To 5 .setsymbolproperty(x, 1, "SymbolText", "Click", 1) .setsymbolproperty(x, 1, "SymbolText", "Here", 2) .setsymbolproperty(x, 1, "DateBack", "transparent") .setsymbolproperty(x, 2, "DateBack", "transparent") .setsymbolproperty(x, 1, "TextBack", "transparent") .setsymbolproperty(x, 2, "TextBack", "transparent") Next x .setcolumnproperty(1, "TextAlign", 1) .setcolumnwidth(1, 2.4) .SetTitle1("Main Project Schedule") .SetTitle2("Click a start symbol to drill down") .setfontstyle(3, 1, 24) .setfontstyle(4, 1, 24) '5. Add symbol HyperLinks to each start symbol .setsymbolproperty(1, 1, "Symbolhyperlink", newfoldername + "\project1.MLp") .save(newfoldername + "\toplevel.MLp") End With 'create the HTML files with hotspots (one step! check it out!) With objmilestonesmain '6. Publish the entire set of schedules with one command! .SetInternetPublishingOptions(2, "DrillDown", 1, 1, 1, 1, "DDTest", 70, 1, 1, 1, 1, 1, 1, 1, 1) .savehtmlhyperlinkdrilldown(newfoldername + "\toplevel.MLp") End With Exit Sub End Sub
|
To effectively program with this interface, it's important to learn all about Milestones Professional. Learn about Milestones.
Milestones Professional 2025 Automation Methods and Properties. © Copyright 2000-2025, KIDASA Software, Inc. All rights reserved.