Breaking Change T837492
Visible to All Users

Office.WinForms - SpreadsheetPropertyEditor and RichTextPropertyEditor content is no longer displayed when printing a view using Print and Export Actions

What happened

Layout print previews may have visual issues in a general case. We removed SpreadsheetPropertyEditor and RichTextPropertyEditor content when the print previews are rendered.

Clipboard-File-2.png

If you are sure that your content is rendered correctly when printing, you can enable this functionality using the following solutions depending on your view type.

How to print the content of these editors in DetailView
Use one of the following solutions:

  • Use the Show in popup context menu command to open a document in a separate window and then use the ribbon's Print commands.
    Clipboard-File-1.png
  • Set the AllowPrint property of the SpreadsheetPropertyEditor or RichTextPropertyEditor classes to True:
C#
using DevExpress.ExpressApp; using DevExpress.ExpressApp.Office.Win; namespace YourSolutionName.Module.Win.Controllers { public class CustomOfficeController : ViewController<DetailView> { protected override void OnActivated() { base.OnActivated(); foreach(RichTextPropertyEditor editor in View.GetItems<RichTextPropertyEditor>()) { editor.AllowPrint = true; } foreach(SpreadsheetPropertyEditor editor in View.GetItems<SpreadsheetPropertyEditor>()) { editor.AllowPrint = true; } } } }
Visual Basic
Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Office.Win Public Class CustomOfficeController Inherits ViewController(Of DetailView) Protected Overrides Sub OnActivated() MyBase.OnActivated() For Each editor As RichTextPropertyEditor In View.GetItems(Of RichTextPropertyEditor)() editor.AllowPrint = True Next editor For Each editor As SpreadsheetPropertyEditor In View.GetItems(Of SpreadsheetPropertyEditor)() editor.AllowPrint = True Next editor End Sub End Class

How to print the content of Rich Text columns in ListView
Set the GridColumn.OptionsColumn.Printable property to True:

C#
using System; using System.Linq; using DevExpress.ExpressApp; using DevExpress.ExpressApp.Win.Editors; using DevExpress.XtraEditors.Repository; using DevExpress.XtraGrid.Columns; using DevExpress.XtraGrid.Views.Grid; namespace YourSolutionName.Module.Win.Controllers { public class EnablePrintingInListViewOfficeController : ViewController<ListView> { protected override void OnActivated() { base.OnActivated(); ViewControlsCreated += EnablePrintingInListViewOfficeController_ViewControlsCreated; } private void EnablePrintingInListViewOfficeController_ViewControlsCreated(object sender, EventArgs e) { GridListEditor listEditor = View.Editor as GridListEditor; if(listEditor != null) { GridView gridView = listEditor.GridView; foreach(GridColumn column in gridView.Columns.Where(column => column.ColumnEdit is RepositoryItemRichTextEdit)) { column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.True; } } } protected override void OnDeactivated() { base.OnDeactivated(); ViewControlsCreated -= EnablePrintingInListViewOfficeController_ViewControlsCreated; } } }
Visual Basic
Imports System Imports System.Linq Imports DevExpress.ExpressApp Imports DevExpress.ExpressApp.Win.Editors Imports DevExpress.XtraEditors.Repository Imports DevExpress.XtraGrid.Columns Imports DevExpress.XtraGrid.Views.Grid Public Class EnablePrintingInListViewOfficeController Inherits ViewController(Of ListView) Protected Overrides Sub OnActivated() MyBase.OnActivated() AddHandler ViewControlsCreated, AddressOf EnablePrintingInListViewOfficeController_ViewControlsCreated End Sub Private Sub EnablePrintingInListViewOfficeController_ViewControlsCreated(ByVal sender As Object, ByVal e As EventArgs) Dim listEditor As GridListEditor = TryCast(View.Editor, GridListEditor) If listEditor IsNot Nothing Then Dim gridView As GridView = listEditor.GridView For Each column As GridColumn In gridView.Columns.Where(Function(currentColumn) TypeOf currentColumn.ColumnEdit Is RepositoryItemRichTextEdit) column.OptionsColumn.Printable = DevExpress.Utils.DefaultBoolean.True Next End If End Sub Protected Overrides Sub OnDeactivated() MyBase.OnDeactivated() RemoveHandler ViewControlsCreated, AddressOf EnablePrintingInListViewOfficeController_ViewControlsCreated End Sub End Class

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.