xdocreport

How to set font in XDocReport using HTML Syntax?


I'm currently using XDocReport 1.0.3 to generate Reports in docx format. When using it with SyntaxKind.HTML I can not get the used font family to be displayed properly in the output document. I figured that there are basically 2 different approaches.

a) Set the font directly in the template that is beeing used. Result is that the font is not recognized and it falls back to the default (here Times New Roman).

b) Set the font-family in the HTML that is being the input data for the document. This doesn't work either and also falls back to the default (Times New Roman).

Is anybody out there that figured how to fix that issue? I'm also going to send a bug report to the XDocReport developers. And reference the response here if any.


Solution

  • We found somewhat of a workaround to this issue. For paragraphs with input proivded by fields of type SyntaxKind.HTML the reporter falls back to the "Standard" template in docx for that paragraph. So the trick is, to adjust the template for "Standard" and set font and styling there. I do only have a german version of Word. Here it is "Formatvorlagen". Maybe this helps someone. It's not ideal, but we got around with it.