• Changing the date format in a template

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #47818  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 1744 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?
Last edited by karmelcoded on Tue Apr 30, 2019 6:18 pm, edited 2 times in total.
 #47830  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.
 #47832  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. .
 #47835  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.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.