Navigation bar
  Home Print document Start Previous page
 145 of 234 
Next page End  

Gravitybox Schedule Primer
Page 143 
1998-2004 Gravitybox Software LLC
Dim oXMLParameters As CXMLParameters
Dim sFileName As String
  
  'This will commit the schedule to file
  Set oXMLParameters = New CXMLParameters
  sFileName = AppPath & GetFileName(Me.MyDate)
  oXMLParameters.FileName = sFileName
  oXMLParameters.Overwrite = True
  oXMLParameters.EmployGMT = False
  oXMLParameters.PropertyAll = False
  Call oXMLParameters.UseAllCollections(False)
  oXMLParameters.VerifyOnly = False
  Call Schedule1.ExportXML(oXMLParameters)
  
  'There is nothing dirty anymore
  Changed = False
EndSub:
  Set oXMLParameters = Nothing
End Sub
Notice that the methods make sure to only save and load the ScheduleItems collection.
The “UseAllCollections” method has been sent a parameter of false. This will ensure
that the Rooms, Categories, and other collections are not saved or loaded to/from file.
The child form has a property called MyDate. This is a property used to identify the date
associated with the form. We will use it later to make sure that we do not load a date
more than once. Notice that this property is set in the OpenFile method. We will make
sure that anytime a form is loaded this method is called. If the file does not exist, we will
load simply load a blank day. If it does exist, we will load it form file. Either way, this
property is set during the method call.
A final method for the child form is the print method. It will print the entire existing
schedule. First we must declare the print parameter object. This stores all the
information about the printing process such as copies, orientation, etc. We set its device
name to the default printer’s device name. This will setup print to work with this printer.
The GoPrint method is flexible. Depending on the configuration of the schedule it takes
differing parameters. Since we are printing a schedule that has been displayed in
RoomOnly mode, the first two parameters are the start room and end room. These are
set to the first and last rooms. The start time is set to the schedule’s start time and the
end time to the schedule’s last displayed time. This will print the entire schedule.
Public Function PrintFile() As Boolean
Dim oPrinterParameter As New CPrinterParameter
http://www.purepage.com