PDF templates and Calculated fields

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF templates and Calculated fields

bwallis42
I have a customer who have designed a PDF form that has two hidden text
fields that are populated from an eForm (section$firstname and
section$surname) and then a third text field with the following adobe
calculated value in it (a Custom Calculation Script)

var f = this.getField("patient-section$pt-given-name").value;
var s = this.getField("patient-section$pt-family-name").value;
event.value = (f + " " + s);

Would you expect this to work?

I suppose that a work around would be to do the calculation in the eform as
a hidden field and reference that from the PDF template.

thanks.

--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: PDF templates and Calculated fields

Alessandro  Vernet
Administrator
Hi Brian,

I suspect this might be caused by the fields being "flattened" in the
generated PDF. See the RFE linked below, and related discussion. I'll add a
+1 from you on that one. From the comments on that issue, it seems like this
might not be too hard to do, so if it might help you, I'd recommend you
bring this up in our Basecamp.

https://github.com/orbeon/orbeon-forms/issues/1260

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: PDF templates and Calculated fields

bwallis42
Thanks Alex,
  I've tried the workaround of a hidden field in the form with a calculated
value, but when I set the field's visibility to 'false' I don't get a
calculated value, the invisible field is no longer in the model and so the
value can't be put in the pdf. If I make the field visible then I get the
desired result in the PDF.

I think I've come across this problem before, making a field invisible
effectively removes it from the data model for the form.

Is there a way around this?

thanks



--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: PDF templates and Calculated fields

Alessandro  Vernet
Administrator
You are correct Brian, calculations aren't done for fields that are set not
to be visible because of what you put under "Visibility". So in this case,
what you want to use is a Calculated Value, which was just introduced in
2018.2, and what you want to do here was one of the use cases we had in
mind. For more on this, see:

https://doc.orbeon.com/form-runner/component/hidden

You'll let me know if it indeed works in the context of a PDF.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet