Posted 21 December 2023, 4:48 am EST
Using AR16
Summary: At runtime, the compatibility mode is set to CrossPlatform, even if the “GDI” option is chosen in the report designer.
Details:
We have a .net 48 project for designing reports, but a .net 6 project for building the assembly. This approach is described elsewhere on this site as a way to address the AR designer’s incompatibility with .Net 6 projects.
We need GDI mode at runtime, so that RichTextBox controls will work as coded. THe RichText issue is also described on this site.
In the designer, we set the compatibility mode to GDI, but we found that the RichTextBox controls still failed at runtime. On further investigation we found that if we added
this.CompatibilityMode = GrapeCity.ActiveReports.Document.CompatibilityModes.GDI
to the report’s constructor, the issue was resolved.
Note that in the designer, if the compatibility mode is set to crossplatform, this line is generated into the InitializeComponent() generated code:
this.CompatibilityMode = GrapeCity.ActiveReports.Document.CompatibilityModes.CrossPlatform;
If in the designer you set the mode to GDI, no line is generated. This implies that GDI is the default. However, it seems that it is not the default.
Summary: to get GDI mode at runtime, you must write the line of code to make it so.