Rendern der Ressourcennutzung und Ressourcenblattansichten

Die Möglichkeit, individuelle Projektansichten zu rendern, beispielsweise Ressourcenverbrauch gegen Aufgaben, ist eine häufigste Voraussetzung für Entwickler, die mit MCPL/XML -Dateien (Microsoft Project) arbeiten. Aspose.Tasks FÜR JAVA unterstützt diese Anforderungen und ermöglicht es Ihnen, Projektressourcen für verschiedene Formate zu übermitteln, z. B. PDF. Die Ressourcennutzung kann mithilfe von Aspose.Tasks ‘PresentationFormat mit unterschiedlichen Zeitskala -Einstellungen wie Days, Thirdofmonths und Monate gerendert werden.

Rendering Ressourcennutzungsansicht

Der Code -Snippet in diesem Artikel liest eine Quell -MPP -Datei, die eine Reihe von Ressourcen enthält, die den Aufgaben zugeordnet sind, und diese in einen Ausgabe -PDF in den folgenden Schritten zugewiesen werden:

  1. Erstellen Sie eine Instanz des Projektlesers.
  2. Lesen Sie die Quell -MPP -Datei.
  3. Initiieren Sie das SaveOptions -Objekt mit den erforderlichen Zeitskala -Einstellungen.
  4. Stellen Sie das Präsentationsformat auf Ressourcenblatt ein.
  5. Rendern Sie das Projekt in die PDF -Ausgabe.
 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.