/
RenderTaskUsageView.php
42 lines (31 loc) · 1.3 KB
/
RenderTaskUsageView.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace Aspose\Tasks\WorkingWithTasks;
use com\aspose\tasks\Project as Project;
use com\aspose\tasks\PdfSaveOptions as PdfSaveOptions;
use com\aspose\tasks\Timescale as Timescale;
use com\aspose\tasks\PresentationFormat as PresentationFormat;
class RenderTaskUsageView{
public static function run($dataDir=null){
# Instantiate project object
$project = new Project($dataDir . 'test_tasks.mpp');
# Define the SaveOptions with required TimeScale settings as Days
$options = new PdfSaveOptions();
$timescale=new Timescale();
$options->setTimescale($timescale->Days);
# Set the Presentation format to ResourceUsage
$presentationFormat=new PresentationFormat();
$options->setPresentationFormat($presentationFormat->TaskUsage);
# Save the Project
$project->save($dataDir . "task_days.pdf", $options);
# Set the Tiemscale settings to ThirdsOfMonths
$options->setTimescale($timescale->ThirdsOfMonths);
# Save the Project
$project->save($dataDir . "task_thirdsOfMonths.pdf", $options);
# Set the Timescale settings to Months
$options->setTimescale($timescale->Months);
# Save the project
$project->save($dataDir . "task_months.pdf", $options);
print "Created task usage view files.".PHP_EOL;
}
}
?>