Office (Edit Rich Text & Spreadsheets)
- 4 minutes to read
The Office Module integrates the following DevExpress controls into an XAF application:
- ASP.NET Core Blazor Rich Text Editor with Mail Merge support
- WinForms Rich Text Editor with Mail Merge support
- ASP.NET Web Forms Rich Text Editor with Mail Merge support
- WinForms Spreadsheet
- ASP.NET Web Forms Spreadsheet
You can try out the Office Module in the Property Editors and Reports sections of the Feature Center demo installed to the following folder: %PUBLIC%\Documents\DevExpress Demos 24.1\Components\XAF\FeatureCenter.NETFramework.XPO.
Note
XAF does not support the Spreadsheet editor for ASP.NET Core Blazor applications.
Office Module Capabilities
Rich Text Editor
The Office Module provides three platform-specific Property Editors:
- ASP.NET Core Blazor
DevExpress.ExpressApp.Office.Blazor.Editors.RichTextPropertyEditor
that uses the DxRichEdit component.- Windows Forms
DevExpress.ExpressApp.Office.Win.RichTextPropertyEditor
that uses RichEditControl.- ASP.NET Web Forms
DevExpress.ExpressApp.Office.Web.ASPxRichTextPropertyEditor
that uses the ASPxRichEdit control.
These editors allow end-users to edit rich text documents stored in different formats.
- ASP.NET Core Blazor
- Windows Forms
- ASP.NET Web Forms
For information on how to access Rich Text Editor controls, refer to the following topic: How to: Access and Customize Rich Text Editor Controls.
Note
Both Blazor Rich Text Editor and DevExpress.ExpressApp.Office.Blazor.Editors.RichTextPropertyEditor
do not support HTML format. If you need to use this format, create a ticket in our Support Center. Set the product field to ‘Blazor / Data Editors for Blazor’ and describe your requirements.
On Linux, the Office Module for Blazor may require additional libraries to be installed. For more information, refer to the following topic: Use Office File API on Linux - Prerequisites.
You can also create Mail Merge templates to generate documents based on data from your application database.
Spreadsheet Editor
The Office Module provides two platform-specific Property Editors:
- Windows Forms
DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor
that uses SpreadsheetControl.- ASP.NET Web Forms
DevExpress.ExpressApp.Office.Web.ASPxSpreadsheetPropertyEditor
that uses the ASPxSpreadsheet control.
These editors allow end-users to edit spreadsheet documents.
For information on how to access Spreadsheet controls, refer to the following topic: How to: Access the Spreadsheet Editor Controls.
- Windows Forms
- ASP.NET Web Forms
Office Module Components
Modules
Platform | Module | NuGet package |
---|---|---|
platform-agnostic | OfficeModule | DevExpress.ExpressApp.Office |
ASP.NET Core Blazor | OfficeBlazorModule | DevExpress.ExpressApp.Office.Blazor |
Windows Forms | OfficeWindowsFormsModule | DevExpress.ExpressApp.Office.Win |
ASP.NET Web Forms | OfficeAspNetModule | DevExpress.ExpressApp.Office.Web |
Application Model Extensions
The Office Module extends the Application Model with the following properties:
Module | Extended node | Extending node | Property |
---|---|---|---|
OfficeModule | |||
OfficeWindowsFormsModule | |||
OfficeAspNetModule | |||
Add the Office Module to Your Application
Install the appropriate platform-specific NuGet package and use one of the following techniques to add the Office Module:
You can add modules to your application when you use the Solution Wizard to create a new XAF solution. Select modules in the Choose Additional Modules step.
In .NET applications, you can call the AddOffice(IModuleBuilder<IBlazorApplicationBuilder>, Action<OfficeOptions>) / AddOffice(IModuleBuilder<IWinApplicationBuilder>, Action<OfficeOptions>) method in your ASP.NET Core Blazor / WinForms application builder.
- If you do not use an application builder, you can add these Modules to the ModuleBase.RequiredModuleTypes collection of the platform-specific Module.
- In .NET Framework applications, you can also use the Module Designer and Application Designer to add a module to your project.
The following additional steps may be required:
ASP.NET Core Blazor Application Without Application Builder
Navigate to the MySolution.Blazor.Server\Startup.cs file and call the AddOffice
method in the Startup.ConfigureServices
method to register the Office Module services in IServiceCollection:
using DevExpress.ExpressApp.Office.Blazor;
// ...
public class Startup {
// ...
public void ConfigureServices(IServiceCollection services){
//...
services.AddOffice();
}
// ...
}