리소스 사용 및 리소스 시트보기 렌더링

작업에 대한 리소스 사용량과 같은 개별 프로젝트보기를 렌더링 할 수 있다는 것은 Microsoft Project (MPP/XML) 파일과 함께 일하는 개발자에게 일반적인 요구 사항입니다. Aspose.Tasks for java는이 요구 사항을 지원하며 PDF와 같은 다양한 형식으로 프로젝트 리소스를 렌더링 할 수 있습니다. 자원 사용량은 며칠, 3 분기 및 달과 같은 시간 규모의 다양한 설정을 갖춘 Aspose.Tasks 의 프레젠테이션 형식을 사용하여 렌더링 할 수 있습니다.

리소스 사용보기 렌더링

이 기사의 코드 스 니펫은 작업에 여러 리소스를 할당하고 다음 단계를 사용하여 출력 PDF로 렌더링하는 소스 MPP 파일을 읽습니다.

  1. 프로젝트 리더의 인스턴스를 만듭니다.
  2. 소스 MPP 파일을 읽으십시오.
  3. 필요한 시간 스케일 설정으로 SaveOptions 객체를 시작하십시오.
  4. 프레젠테이션 형식을 리소스 시트로 설정하십시오.
  5. 프로젝트를 PDF 출력으로 렌더링하십시오.
 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(RenderResourceUsageandsheetView.class);
 4
 5// Read the source Project
 6Project project = new Project(dataDir + "RenderMe.mpp");
 7// Define the SaveOptions with required TimeScale settings as Days
 8SaveOptions options = new PdfSaveOptions();
 9options.setTimescale(Timescale.Days);
10// Set the Presentation format to ResourceUsage
11options.setPresentationFormat(PresentationFormat.ResourceUsage);
12String days = "result_days.pdf";
13project.save(days, options);
14
15// Set the Tiemscale settings to ThirdsOfMonths
16options.setTimescale(Timescale.ThirdsOfMonths);
17String thirds = "result_thirdsOfMonths.pdf";
18project.save(thirds, options);
19
20// Set the Timescale settings to Months
21options.setTimescale(Timescale.Months);
22String months = "result_months.pdf";
23// Save the project
24project.save(months, options);

Rendering Resource Sheet View

 1// For complete examples and data files, please go to https://github.com/aspose-tasks/Aspose.Tasks-for-Java
 2// The path to the documents directory.
 3String dataDir = Utils.getDataDir(RenderResourceUsageandsheetView.class);
 4
 5// Read the source Project
 6Project project = new Project(dataDir + "TASKSNET_33285.mpp");
 7// Define the SaveOptions
 8SaveOptions options = new PdfSaveOptions();
 9
10// Set the Presentation format to ResourceSheet
11options.setPresentationFormat(PresentationFormat.ResourceSheet);
12project.save("result.pdf", options);
Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.