Hi,
We have added custom in the web report designer's Init method.
It's successfully showing in the web report designer but when saving it reverts back to to Microsoft San Serif.
Any help would be appreciated. Thanks.
Hi,
We have added custom in the web report designer's Init method.
It's successfully showing in the web report designer but when saving it reverts back to to Microsoft San Serif.
Any help would be appreciated. Thanks.
Hello Edward,
This behavior may be caused by the fact that the fonts that you are adding to the Web Report Designer are not installed on your web server. So, please make sure that all these fonts are installed on your web server. Note that if you are using a Windows Server OS, you need to install a font for the IIS user that hosts the application. Also, all Windows machines should be restarted after font installation.
Additionally, I would like to note that you do not even need to use the updateFont
method. All the fonts that were installed on your web server should be loaded to the Web Report Designer automatically.
If you are unable to install a font to your web server, please elaborate on why you cannot do this. Do you use a hosting environment that does not support font installation? This information will help us look for alternative solutions for you.
Hello Edward,
This is the expected behavior of the [XRRichText][1] control. This control contains text that is already formatted: RTF or HTML content. So, you need to apply the desired font at the level of RTF or HTML document that is loaded into the [XRRichText][1] control.
Hi Vasily,
We have already added the font in the HTML editor and the font is not applied.
Can you provide an example how to add a custom font?
Hi Edward,
Allow me to follow up. From the reporting perspective, we're trying to parse and display the HTML content you supply (that is, the tags it contains). This content itself can be produced in many ways, and we do not really know or care if you used an HTML editor for this task or some other means. Now, assuming the content you supply is valid (by the way, it would be great if you could share an example), there are two issues you may encounter:
1) Settings XRRichText.Font at runtime does not result in any changes. Reason:
There is no single "effective" font that we can find in the case of XRLabel
. The settings that you see in the "Property Grid" window are for design-time editing only; the runtime appearance is entirely a part of the bound RTF/HTML content. Even if you have "plain text" stored in your datasource, it's still treated as a paragraph with default formatting. If you wish to obtain (and possibly change) all fonts in use, subscribe to the XRRichText.BeforePrint
event/script handler and pre-process the bound HTML/RTF content using the RichEditDocumentServer class. See Common cases of using RichEditDocumentServer in XtraReports.
2) The target font was correctly specified in HTML / in a document model, but a different font is used to render the content. Reason:
In Azure App Service, you can't install custom fonts in a sandbox environment. The PrivateFontCollection class can't help here as it is not supported either. If you intend to use Azure App Service, you'll likely see that the required font is not present by default and it is impossible to install custom fonts in a sandbox environment (regardless of the subscription plan). Note that it is essential to install a font — adding it to a web page won't help as report document generation takes place on the server side (Document Viewer Lifecycle).
To work around this limitation, you can use a Windows container, a Linux container, or a fully-fledged virtual machine. Note that Microsoft's advice is to use containers if you need things like custom fonts or custom software: https://docs.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-windows.dx.
I recommend you try out the Linux container. Follow steps listed in the Use the DevExpress Cross-Platform Drawing Engine help topic to enable the enhanced drawing engine and make the report's output on Linux similar to Windows.
If you're positive, though, that the default runtime environment already contains all the fonts you need (Obtain installed fonts as a list), try enabling the AzureCompatibility.Enable property.
I hope this helps. Let us know if anything remains unclear.
Regards,
Yaroslav
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.