리소스 사용보기 렌더링
Contents
[
Hide
Show
]예를 들어, 마이크로 소프트 프로젝트 (MPP/XML) 파일과 함께 일하는 개발자에게는 개별 프로젝트보기 (예 : 작업에 대한 리소스 사용)가 일반적인 요구 사항입니다. ASPOSE.TASK의 C ++ API는이 요구 사항을 지원하며 프로젝트 리소스를 다양한 형식으로 렌더링 할 수 있습니다. PDF. 자원 사용량은 Aspose.Tasks ‘ PresentationFormat를 사용하여 렌더링 할 수 있습니다.
리소스 사용보기 렌더링
이 기사의 코드 스 니펫은 작업에 여러 리소스를 할당하고 다음 단계를 사용하여 출력 PDF로 렌더링하는 소스 MPP 파일을 읽습니다.
- 프로젝트 리더 인스턴스를 만듭니다.
- 소스 MPP 파일을 읽으십시오.
- 필요한 시간 스케일 설정으로 SaveOptions 객체를 시작하십시오.
- 프레젠테이션 형식을 리소스 시트로 설정하십시오.
- 프로젝트를 PDF 출력으로 렌더링하십시오.
1// Create project instance
2System::SharedPtr<Project> project1 = System::MakeObject<Project>(dataDir + u"ResourceUsageView.mpp");
3
4// Define the SaveOptions with required TimeScale settings as Days
5System::SharedPtr<SaveOptions> options = System::MakeObject<PdfSaveOptions>();
6options->set_Timescale(Aspose::Tasks::Visualization::Timescale::Days);
7
8// Set the Presentation format to ResourceUsage
9options->set_PresentationFormat(Aspose::Tasks::Visualization::PresentationFormat::ResourceUsage);
10
11// Save the Project
12System::String outputFile = u"result_ResourceUsageView_days_out.pdf";
13project1->Save(dataDir + outputFile, options);
14
15// Set the Tiemscale settings to ThirdsOfMonths and save the Project
16options->set_Timescale(Aspose::Tasks::Visualization::Timescale::ThirdsOfMonths);
17outputFile = u"result_ResourceUsageView_thirdsOfMonths_out.pdf";
18project1->Save(dataDir + outputFile, options);
19
20// Set the Timescale settings to Months and save the Project
21options->set_Timescale(Aspose::Tasks::Visualization::Timescale::Months);
22outputFile = u"result_ResourceUsageView_months_out.pdf";
23project1->Save(dataDir + outputFile, options);