Rendering Resource Usage View
The Resource Usage view in Microsoft Project shows how resources are allocated to different tasks over time. It provides detailed insight into:
- Resource assignments to tasks
- Work distribution across a timeline
- Usage patterns such as daily, weekly, or monthly workloads
This view is essential for monitoring and balancing workload distribution across resources. Aspose.Tasks for .NET enables developers to render the Resource Usage view to various formats (e.g., PDF) using the PresentationFormat enumerator. You can also specify different timescale options (Days, ThirdsOfMonths, Months) for flexible reporting.
Rendering Resource Usage View
The code snippet in this article reads a source MPP file that has a number of resources assigned to tasks and renders these to an output PDF using the following steps:
- Create an instance of the Project Reader.
- Read the source MPP file.
- Initiate the SaveOptions object with the required timescale settings.
- Set the presentation format to Resource Sheet.
- Render the project to PDF output.
This allows you to generate accurate, presentation-ready reports of resource usage directly from Microsoft Project files without requiring Microsoft Project installed.
The following code example demonstrates how to render the Resource Usage view with custom timescale options:
1Project project = new Project("New Project.mpp");
2// Define the SaveOptions with required TimeScale settings as Days
3SaveOptions options = new PdfSaveOptions();
4options.Timescale = Timescale.Days;
5
6// Set the Presentation format to ResourceUsage
7options.PresentationFormat = PresentationFormat.ResourceUsage;
8
9project.Save("result_ResourceUsageView_days_out.pdf", options);
10
11// Set the Timescale settings to ThirdsOfMonths and save the Project
12options.Timescale = Timescale.ThirdsOfMonths;
13project.Save("result_ResourceUsageView_thirdsOfMonths_out.pdf", options);
14
15// Set the Timescale settings to Months and save the Project
16options.Timescale = Timescale.Months;
17project.Save("result_ResourceUsageView_months_out.pdf", options);
Conclusion
Using Aspose.Tasks for .NET, you can easily export Resource Usage views to share with stakeholders, generate workload reports, or integrate them into project documentation. The ability to adjust timescale granularity makes it highly adaptable for different reporting needs (daily operational reports, monthly summaries, or executive overviews).