Office (Edit Rich Text & Spreadsheets)
- 4 minutes to read
The Office Module integrates the following DevExpress controls into an XAF application:
- WinForms Rich Text Editor with Mail Merge support
- ASP.NET Web Forms Rich Text Editor with Mail Merge support
- ASP.NET Core Blazor Rich Text Editor
- WinForms Spreadsheet
- ASP.NET Web Forms Spreadsheet
You can see a demonstration of the Office Module in the Property Editors and Reports sections of the Feature Center demo installed in the %PUBLIC%\Documents\DevExpress Demos 21.2\Components\eXpressApp Framework\FeatureCenter folder.
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:
- the DevExpress.ExpressApp.Office.Win.RichTextPropertyEditor, which uses the RichEditControl in WinForms applications
- the DevExpress.ExpressApp.Office.Web.ASPxRichTextPropertyEditor, which uses the ASPxRichEdit control in ASP.NET Web Forms applications
- the DevExpress.ExpressApp.Office.Blazor.Editors.RichTextPropertyEditor, which uses the DxRichEdit component in ASP.NET Core Blazor applications
These editors allow end-users to edit rich text documents stored in different formats.
You can also create Mail Merge templates to generate documents based on data from your application database.
Note
ASP.NET Core Blazor applications do not support Mail Merge templates.
See Also
- How to: Access the Rich Text Editor Controls
- How to: Customize the Rich Text Editors
- Ways to Improve the Performance of ASP.NET Web Forms Office Module Editors
Spreadsheet Editor
The Office Module provides two platform-specific Property Editors:
- the DevExpress.ExpressApp.Office.Win.SpreadsheetPropertyEditor, which uses the SpreadsheetControl in WinForms applications
- the DevExpress.ExpressApp.Office.Web.ASPxSpreadsheetPropertyEditor, which uses the ASPxSpreadsheet control in ASP.NET Web Forms applications
These editors allow end-users to edit spreadsheet documents.
See Also
- How to: Access the Spreadsheet Editor Controls
- How to: Customize the Spreadsheet Editors
- Ways to Improve the Performance of ASP.NET Web Forms Office Module Editors
Office Module Components
Modules
Platform | Module |
---|---|
platform-agnostic | OfficeModule |
WinForms | OfficeWindowsFormsModule |
ASP.NET Web Forms | OfficeAspNetModule |
ASP.NET Core Blazor | OfficeBlazorModule |
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
Follow the steps below to add the Office Module to your application. If you added this Module when you created an XAF application, the Solution Wizard generates the following code automatically:
Add the following NuGet packages:
Package
Project
DevExpress.ExpressApp.Office
platform-agnostic module project
(MySolution.Module)DevExpress.ExpressApp.Office.Blazor
Blazor-specific module project
(MySolution.Blazor.Server)DevExpress.ExpressApp.Office.Win
WinForms-specific module project
(MySolution.Win)DevExpress.ExpressApp.Office.Web
ASP.NET Web Forms-specific module project
(MySolution.Web)In the application constructor, add the platform agnostic and platform-specific Office Modules to the Modules collection:
WinForms
File: MySolution.Win\WinApplication.cs.using DevExpress.ExpressApp.Office; using DevExpress.ExpressApp.Office.Win; // ... public partial class MySolutionWindowsFormsApplication : WinApplication { public MySolutionWindowsFormsApplication() { // ... Modules.Add(new OfficeModule()); Modules.Add(new OfficeWindowsFormsModule()); } // ... }
ASP.NET Web Forms
File: MySolution.Web\WebApplication.cs.using DevExpress.ExpressApp.Office; using DevExpress.ExpressApp.Office.Web; // ... public partial class MySolutionAspNetApplication : WebApplication { public MySolutionAspNetApplication() { // ... Modules.Add(new OfficeModule()); Modules.Add(new OfficeAspNetModule()); } // ... }
ASP.NET Core Blazor
File: MySolution.Blazor.Server\BlazorApplication.cs.using DevExpress.ExpressApp.Office; using DevExpress.ExpressApp.Office.Blazor; // ... public partial class MySolutionBlazorApplication : BlazorApplication { public MySolutionBlazorApplication() { // ... Modules.Add(new OfficeModule()); Modules.Add(new OfficeBlazorModule()); } // ... }
Tip
- Alternatively, 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.
In ASP.NET Core Blazor applications, call AddXafOffice in the Startup.ConfigureServices method to register the required Office Module services in IServiceCollection:
File: MySolution.Blazor.Server\Startup.cs.
using DevExpress.ExpressApp.Office.Blazor; // ... public class Startup { // ... public void ConfigureServices(IServiceCollection services){ //... services.AddXafOffice(); } // ... }