Visually correct placeholder could not be found xdocreports ODT to PDF generation

617 Views Asked by At

While using ODT template, We found that visually correct typescript placeholder, for example, ${val} does not work and throws the exception shown below. While retyping ${val}. Works!

I could be a real problem when the end users change template.

Also, I could not find the configuration to ignore placeholders which are not evaluated/replaced by the application.

FYI: All placeholders are populated by the application. So, I am not using incorrect placeholder values.

Is there a way to sanitize ORT content to remove a... I assume encoding issue?

What works?

  • Retyping placeholder in the ODT template
  • Copying working placeholder

What does not work?

  • Changing font
  • Adding or removing spaces around the placeholder
  • Adding the exclamation symbol. Like: ${val!}
  • etc

Exception:

       java.lang.RuntimeException: freemarker.core.ParseException: Syntax error in template "fr.opensagres.xdocreport.document.odt.ODTReport@7286f0a!content.xml" in line 4, column 80236: Encountered "/", but was expecting one of:
<STRING_LITERAL>
<RAW_STRING>
"false"
"true"
<INTEGER>
<DECIMAL>
"."
"+"
"-"
"!"
2

There are 2 best solutions below

0
Viktor Reinok On

Lets say You have an working .odt template. You open the template in MS Word and make minor changes, save and there is the error is sure to appear.

The solution was to use Libre office Saving file does not cause such issues, still it is not as convenient solution. End users are used with MS word.

0
YouCL On

I had the similar issue for a long time, and I followed the github opensagres/xdocreport, it works fine until now.