Page 1 of 1

Changing the date format in a template

PostPosted:Fri Apr 26, 2019 2:33 pm
by karmelcoded
Hi,
I'm trying to change the format in a Openoffice PDF template in OpenKM CM 6.3.7 to mm/dd/yyyy but I can't seem to figure it out. I can show the date in the PDF template like this
Untitled 21.png
Untitled 21.png (9.72 KiB) Viewed 2115 times
but I can't figure out how to change it. I tried to using ${okp_tpl_bird_date?string("MM-dd-yyyy")} to change the format but It only seems to work in an Openoffice template (.odt). So my question is how can I use ${okp_tpl_bird_date?string("MM-dd-yyyy")} in a Openoffice PDF template?

Re: Changing the date format in a template

PostPosted:Sat Apr 27, 2019 10:37 am
by jllort
It is raised an error when you set into PDF? can you share here the stack trace error?
I have done a quick code check and seems we are using thymeleaf as in odt case, I think should also working for PDF, that's why I would like to check the stack trace error.

Re: Changing the date format in a template

PostPosted:Mon Apr 29, 2019 7:01 pm
by karmelcoded
Catalina.log does not show any errors when I try to create a form from the PDF template using the attached file , It just won't show the date in the form. Here is the Openoffice File. This template works as expected but only as an Openoffice template with use of a drawing tools text box. .

Re: Changing the date format in a template

PostPosted:Tue Apr 30, 2019 7:16 pm
by karmelcoded
I believe I misunderstood the directions for creating a template https://docs.openkm.com/kcenter/view/ok ... lates.html. In order to change the format to MM-dd-yyyy you must first add the "Template field name" in the the Openoffice Form Control Text Box as the name eg: okp_tpl_birth_date. Then you must use the "Template field value" ${okp_tpl_birth_date?string("MM-dd-yyyy")} as the actual form data after turning Design Mode "Off". Finally you can export the Openoffice document as a PDF. I have provide an example of both the Openoffice and PDF document for anyone who has the same problem.
Thanks for the help jllort.