Convierta el archivo MPP del Proyecto Microsoft
Este artículo describe cómo convertir los archivos MPP del Proyecto Microsoft a varios formatos de salida, incluidos HTML, Texto sin formato y Plantilla de Proyecto Microsoft (MPT) utilizando Aspose.Tasks para .NET. La API proporciona un conjunto completo de características para personalizar la salida, incluida la manejo de recursos, la configuración del encabezado, las opciones de estilo y el filtrado de contenido. Cada formato está cubierto con ejemplos prácticos y pasos de personalización opcionales.
Microsoft Project (MSP) permite a los desarrolladores guardar los datos del proyecto (MPP/XML) en plantillas HTML, Text and MPT. Aspose.Tasks también le permite guardar los datos del proyecto en los mismos formatos similares a MSP. Esto se logra utilizando el método de guardado estándar expuesto por la clase Proyecto.
Guardar datos del proyecto como html
La clase HTMLSaveOptions permite a los desarrolladores controlar el diseño y el contenido de los archivos HTML exportados. Admite exportación de múltiples páginas, configuración de tamaño de página, selección de escala de tiempo e incrustación o externalización de CSS, fuentes e imágenes. Aspose.Tasks puede exportar los datos del proyecto al formato HTML. Permite guardar todos los datos en HTML o exportar solo las páginas requeridas a HTML utilizando las SaveOptions como se muestra en las siguientes muestras de código.
Controlling Header and Title Output in HTML
By default, the exported HTML document includes the project name in the HTML <title>
and in the document’s page header. You can disable either of these elements by modifying the corresponding properties of the HtmlSaveOptions
class.
Saving Fonts, Images and CSS Styles Separately
Aspose.Tasks supports saving fonts, images, and CSS styles as external files. This is particularly useful when you want to integrate HTML output into an existing website or manage styling separately from the content. This is achieved using the HtmlSaveOptions class by providing information about CSS, Font and Image destinations. The resource export behavior can be configured through HtmlSaveOptions.ExportFonts, ExportImages, and ExportCss.
Adding Custom Prefixes to CSS Class Names While Exporting to HTML
To avoid CSS class name conflicts when integrating the exported HTML into a broader application, you can define a custom prefix using the CssStylePrefix
property.
Save Project to Text
Project data can be exported to plain text using SaveFileFormat.TXT
. This format is intended for simple logging, debugging, or archival purposes.
Save Project Data as Template (MPT)
Aspose.Tasks allows saving a project as a Microsoft Project Template (MPT) file. This is useful when you want to create reusable project structures. Use the SaveAsTemplate
method and configure optional parameters through the SaveTemplateOptions
class to remove actual and baseline values.
Conclusion
Aspose.Tasks for .NET provides flexible and developer-friendly methods for exporting project data to multiple formats, including HTML, text, and templates. With the help of configuration classes such as HtmlSaveOptions and SaveTemplateOptions, developers can fine-tune the output to meet a wide range of business requirements. For additional details, refer to the API Reference or explore other export scenarios in the documentation.