Module: Asposetasksjava::FiscalYearProperties

Defined in:
lib/asposetasksjava/Projects/fiscalyearproperties.rb

Instance Method Summary collapse

Instance Method Details

#get_fiscal_year_propertiesObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/asposetasksjava/Projects/fiscalyearproperties.rb', line 11

def get_fiscal_year_properties()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Instantiate project object
    project = Rjb::import('com.aspose.tasks.Project').new(data_dir + 'test_tasks.mpp')

    prj = Rjb::import('com.aspose.tasks.Prj')

    # Display fiscal year properties
    puts "Fiscal Year Start Date : " + project.get(prj.FY_START_DATE).toString()
    puts "Fiscal Year Numbering : " + project.get(prj.FISCAL_YEAR_START).toString()
end

#initializeObject



3
4
5
6
7
8
9
# File 'lib/asposetasksjava/Projects/fiscalyearproperties.rb', line 3

def initialize()
    # Reading Fiscal Year Properties
    get_fiscal_year_properties()

    # Writing Fiscal Year Properties 
    set_fiscal_year_properties()
end

#set_fiscal_year_propertiesObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/asposetasksjava/Projects/fiscalyearproperties.rb', line 24

def set_fiscal_year_properties()
    data_dir = File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) + '/data/'
            
    # Instantiate project object
    project = Rjb::import('com.aspose.tasks.Project').new

    prj = Rjb::import('com.aspose.tasks.Prj')

    # Set fiscal year properties
    project.set(prj.FY_START_DATE, Rjb::import('com.aspose.tasks.Month').July)
    project.set(prj.FISCAL_YEAR_START, Rjb::import('com.aspose.tasks.NullableBool').new(true))

    project.save(data_dir + "fiscal_year_properties.xml", Rjb::import('com.aspose.tasks.SaveFileFormat').XML)

    puts "Set fiscal year properties, please check the output file."
end