Skip to main content
A newer version of this page is available. .
All docs
V22.2

Troubleshooting

  • 2 minutes to read

The DevExpress Project Converter updates your projects automatically and converts the changed API without causing errors. The following article describes possible issues and troubleshooting tips when you migrate your project to the DevExpress.Drawing graphics library.

Reporting Applications Troubleshooting

Adjust Font Settings

The following API has the DXFont type:

An issue might occur with missing font properties, such as FontFamily, GdiCharSet, and so on.

Replace the FontFamily Property

To resolve the issue with the Font.FontFamily property, replace the Font class initialization with DXFont. Use the DXFont.Name property instead of the FontFamily property when creating a new font:

DXFont font = new DXFont(e.Graph.DefaultFont.Name, 14, DXFontStyle.Bold);

Specify GDI+ Properties

You can use the DXFontAdditionalProperty class to pass additional properties (including GDI+ properties) to the font. The additional property’s name should match the property in the Font class.

The code sample below specifies a Font.GdiCharSet to the DXFont type:

DXFont font = new DXFont("Font", 14, DXFontStyle.Regular, 
    DXGraphicsUnit.Point, new DXFontAdditionalProperty[] { 
        new DXFontAdditionalProperty(DXFontAdditionalProperty.GdiCharSet, (byte)0) });

Note

The GDI+ font settings work only on Windows OS and GDI+ drawing.

Use Custom Fonts

You can use the class for custom fonts. Refer to the following article for more information:

Read Tutorial: Use DXFontRepository to Add Custom Fonts

Handle the BeforePrint Event

In the scope of the T1125446 breaking change, the XRControl.BeforePrint uses the DevExpress.XtraReports.UI.BeforePrintEventHandler delegate and the CancelEventArgs class. The PrintOnPageEventArgs class now descends from CancelEventArgs as well.

You can change your event handlers as follows:

using DevExpress.XtraReports.UI;
using System.ComponentModel;

xrControl1.BeforePrint += new BeforePrintEventHandler(xrControl1_BeforePrint)
xrControl1.BeforePrint -= new BeforePrintEventHandler(xrControl1_BeforePrint)
//...
private void xrControl1_BeforePrint(object sender, CancelEventArgs e)
{
    //...
}