Render doesn't replace conditional text in a simple doc

Asked by Sterling Hoeree on 2013-07-26

I've been trying to do something super simple from the main "how to," namely:

1) Create an .odt document, called "hello.odt", which looks like:

Hello name!

... Where "name" is a Conditional text field (created with CTRL+F2), Condition set to "true", Then set to "name", Else blank.

2) call renderer.run() in python:

from appy.pod.renderer import Renderer
vars = { 'name' : 'Bonzoo' }
r = Renderer("hello.odt", vars, "out.odt")
r.run()

Unfortunately, the result of this is... the same as the original document! Nothing changes at all.
What am I doing wrong?

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Appy Edit question
Assignee:
No assignee Edit question
Solved by:
Sterling Hoeree
Solved:
2013-07-26
Last query:
2013-07-26
Last reply:

I found the answer.

It turns out that we *don't use Conditional text fields* to do this. Instead, in LibreOffice, go to Edit->Changes->Record and check the box, then type the field (in my case, "name"). Finally, go back to Edit->Changes->Record and uncheck the box.

Source: http://www.web2pyslices.com/slice/show/1568/create-pdf-reports-using-pod-library

Unfortunately it wasn't too clear on the "getting started" part of the project page, unless I missed it somehow. :)

Hope this helps anyone else who might run into this problem!