PDF-muodossa näkyvät kokonaisvaltaiset resurssit PDF-tiedostoissa Aspose.Tasks PDF-muodostus on erinomainen tapa korostaa aikataulutusriskejä Microsoft Project -tiedoissa.Kun työskentelet Aspose.Tasks for .NET Aspose.Tasks .NET export PDF, puuttuvat kohokohdat johtuvat yleensä väärän tulostusnäkymän valitsemisesta, projektin uudelleenlaskennasta tai viennistä ilman tarkoitukseen rakennettua raporttia.Tässä oppaassa näytetään luotettava polku, joka toimii suurissa projekteissa ja välttää yleisiä ansoja, korjaa PDF-muodostusongelmia Aspose.Tasks.
Avainottelut
- Käytä sitä Integroituja resursseja koskeva raportti kokonaisresurssien raportti Aspose.Työt PDF:n luomiseksi, joka selvästi merkitsee ongelma-resursseja.
- Setä
CalculationMode = Automatic(tai soittaaRecalculate()) ennen Microsoft Project PDF -raportin viemistä, jotta yleistämislipput ovat tuoreita. - Yksityiskohtaisen työkuormituskontekstiin myös vienti Resurssien käyttö Katso PDF päivittäisellä aikataululla.
- Suuret tiedostot: esisuodatin-tiedot ja sivun säätöasetukset sivujen määrän ja vientiajan vähentämiseksi.
Miksi korostaminen epäonnistuu (ja miten se korjataan)
- Jatkuvat laskelmat — yleiskatsaus liput ovat laskettuja arvoja. Varmista, että projekti on laskettu uudelleen ennen vientiä.
- Väärä tuotanto yleiskuvat (esimerkiksi yksinkertainen Gantt) eivät näytä yleiskokoonpanon indikaattoreita. Ylipainotettujen resurssien raportti tai Resurssikäyttö / Resource Sheet Näkökulmia siis.
- Leikattu sisältö — Oletusarvoinen sivun koko/aikakaava voi tehdä PDF-tiedostoista valtavia.
Täydellinen, koottava esimerkki (C#)
using System;
using Aspose.Tasks;
using Aspose.Tasks.Saving;
using Aspose.Tasks.Visualization;
namespace TasksPdfHighlight
{
internal static class Program
{
// How to run:
// 1) dotnet new console -n TasksPdfHighlight
// 2) cd TasksPdfHighlight
// 3) dotnet add package Aspose.Tasks
// 4) Replace Program.cs with this file's contents
// 5) dotnet run -- "path-to-input.mpp"
private static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine("Usage: dotnet run -- <path-to-input.mpp>");
return;
}
string input = args[0];
// 1) Load the project
var project = new Project(input)
{
// Keep calculations up to date so overallocation flags are reliable
CalculationMode = CalculationMode.Automatic
};
// Optional explicit refresh (useful if CalculationMode was Manual/None earlier)
project.Recalculate();
// 2) Export the built-in Overallocated Resources report (purpose-built for this task)
string reportPdf = "OverallocatedResources.pdf";
project.SaveReport(reportPdf, ReportType.OverallocatedResources);
Console.WriteLine($"Saved: {reportPdf}");
// 3) (Optional) Also render Resource Usage view for day-by-day context
var usageOptions = new PdfSaveOptions
{
PresentationFormat = PresentationFormat.ResourceUsage,
Timescale = Timescale.Days,
FitContent = true,
ReduceFooterGap = true
};
string usagePdf = "ResourceUsage.pdf";
project.Save(usagePdf, usageOptions);
Console.WriteLine($"Saved: {usagePdf}");
// 4) Quick console summary: list resources with any overallocated assignments
foreach (var ra in project.ResourceAssignments)
{
if (ra.Overallocated)
{
string resName = ra.Resource?.Get(Rsc.Name) ?? "(Unnamed Resource)";
string taskName = ra.Task?.Get(Tsk.Name) ?? "(Unnamed Task)";
Console.WriteLine($"OVERALLOCATED: Resource='{resName}' on Task='{taskName}'");
}
}
}
}
}
## How to run
1. `dotnet new console -n TasksPdfHighlight`
2. `cd TasksPdfHighlight`
3. `dotnet add package Aspose.Tasks`
4. Replace `Program.cs` with the code above.
5. `dotnet run -- "path-to-input.mpp"`
### What the code does
* **Loads** your `.mpp` file and enables **automatic calculation** to ensure flags are accurate.
* **Exports** a clear, one‑page‑per‑report **Overallocated Resources** PDF designed to call out problem resources.
* **Optionally renders** the **Resource Usage** view as a second PDF to inspect day‑by‑day workload distribution.
* **Prints** a quick summary of any overallocated assignments to the console.
## Troubleshooting & performance tips
* **PDF is very large**: use `Timescale = Timescale.Months` for broad summaries or shorten the project date range.
* **Missing highlights**: verify the project recalculates (`Automatic` mode or `Recalculate()`), and prefer `SaveReport(…, ReportType.OverallocatedResources)` over generic views.
* **Fonts/locale**: if characters are missing, deploy the required fonts on the server or handle font resolve events.
## FAQ
**Q1. Does Aspose.Tasks detect resource overallocation automatically?**
Yes. Overallocation is reflected on tasks and assignments. You can check fields like `Tsk.IsOverallocated` (per task) and `ResourceAssignment.Overallocated` (per assignment) in code.
**Q2. What’s the difference between the Overallocated Resources report and the Resource Usage view?**
The report is a purpose‑built summary highlighting problem resources; the Usage view shows time‑phased workload details. Use both for a complete picture.
**Q3. Can I “color” only overallocated rows in a sheet view?**
Direct per‑row conditional styling in sheet views is limited. A practical workaround is to export the **Overallocated Resources report** for highlights, and separately export **Resource Usage/Resource Sheet** views (optionally filtered) for context.
**Q4. How can I speed up exports for very large MPP files?**
Filter out inactive/complete portions, choose coarser timescales (weeks/months), and avoid rendering every view. Export the targeted report first.
**Q5. Do I need Microsoft Project installed?**
No. Aspose.Tasks works independently. Just ensure fonts used by the project are available to the rendering environment.
## Conclusion
When you need reliable PDF output that **highlights overallocated resources**, prefer the **Overallocated Resources** report and ensure the project is recalculated before export. For deeper analysis, add a Resource Usage PDF with a suitable timescale and keep page settings conservative for large files.
More in this category
- VALIDATION FEEDBACK - Käsittele seuraavat ongelmat: ERRORIT (on korjattava): 1. Etusivun kenttä 'titteli' havaittiin 'en' (luotettavuus 86%), odotettu 'fi'. Esikatselu: 'MPP PDF: Custom Layout & Scaling .NETissä' LÄHDE: MPP to PDF: Custom Layout & Scaling in .NET
- MS Project Viewer Online - MPP File Viewer
- Muunna MS Project PDF:ään C#:ssä