JsReport not rendering docxCheckbox - docker

I have a Docker Image where jsReport is rendering a custom doxc file to a pdf. I have normal string values like firstname and lastname + some checkboxes depending on previous user input.
Evening works fine for the string values, but the checkboxes will not get rendered.
After rendering, it looks like this:
The data looks like this:
{
"customer": {
"fullName": "John Doe",
"birthDate": "10.10.1999",
"companyRegistrationNumber": " / AB123456",
"fullAddress": "Street 1234 B5",
"email": "mail#support.com"
},
"date": "11.09.2022",
"ready": true
}
It is rendering something, it even uses the "ready" value because it displays the same string as "true", but it is not displaying a checkbox

The docxCheckbox helper call needs to be placed in the title of the word checkbox.
See the documentation
https://jsreport.net/learn/docx#forms
And the demo
https://playground.jsreport.net/w/anon/DtnCaXMs

The property menu is not available with the right-click menu. It is only in the developers tab

Related

How to return friendly field names for zapier trigger (zapier developers)

I am working on a Zapier integration for an online form builder. Each unique form for our users has lots of long, auto-generated field names.
We have a trigger called “New form entries”, which polls our server for form entries, and comes back like this:
[
{
"id": "6209aee326baa600224d822c",
"email_907058157108782": "test#test.com",
"phone_589083232390193": "12345",
},
{
"id": "61fd629f19408200225e1893",
"email_907058157108782": "test#test2.com",
"phone_589083232390193": "54321",
},
]
However, this results in end users seeing these really long, gross field names in the Zapier interface:
My question: how do I get Zapier to display friendly labels to the user, whilst using the unique field IDs behind the scenes?
I’m thinking of returning something like the following (each object represents a form entry, , but I need to know how to actually use “friendlyFieldName” and “value” in Zapier!-
[
{
// the id for the entry
"id": "62179ec5ab9daa0022df7d1d",
// the id for the first field entry
"text_576692390099896": {
// a friendly name and value for zapier
"friendlyFieldName": "What is your favourite colour?",
"value": "Blue"
}
}
]
Thank you :)
You can define output fields labels in outputFields. Here are the reference document that you can follow: Output Fields

How to have a standard block kit interactive component look like a modal input

I'm building a modal that has several select inputs on it. The values entered get posted to my server when the user clicks the modal submit button. However, for one of the selects I need it to post to the server immediately when the user interacts with it - and from what I understand, inputs don't do this.
So, I'm using an "Actions" layout block for one of the static select elements. However, the select looks nothing like the equivilent input static select. It's smaller and doesn't fill the full width of the video. Is there any way to do this?
You can use an input staticSelect and set the dispatchAction to true
{
"dispatch_action": true,
"type": "input",
"element": {
"type": "plain_text_input",
"action_id": "plain_text_input-action"
},
"label": {
"type": "plain_text",
"text": "Label",
"emoji": true
}
}
this works for the staticSelect as well

Can jenkins extended choice parameter be made dependent on another parameter's value?

I am using extended choice parameter with JSON parameter type in my declarative Jenkins pipeline. I have found it very good for providing custom UI for parameters and it returns a json based on user inputs.
I have a use case where what options are shown to user depends upon another parameter's value. I can achieve such functionality with active choice parameter but then I am stuck with radio buttons, checkbox, html input etc.
I found a suitable option here where I can make a property inside json dependent on another property:
{
"title": "An object",
"type": "object",
"properties": {
"fieldOne": {
"title": "I should be changed to 'foo'",
"type": "string",
"enum": ["foo","bar"],
"default": "bar"
},
"depender1": {
"title": "I depend on fieldOne to be 'foo'",
"type": "string",
"enum": ["lorem","ipsum"],
"options": {
"dependencies": {
"fieldOne": "foo"
}
}
},
"depender2": {
"title": "I depend on fieldOne to be 'bar'",
"type": "string",
"enum": ["dolor", "sit"],
"options": {
"dependencies": {
"fieldOne": "bar"
}
}
}
}
}
This works great when I try it here
But when I try the same on jenkins, it doesn't work. It shows all 3 textboxes. I saw the option of watching other params too but I couldn't find how to use it as an if else for my parameter.
This is a simple example, what I want to achieve requires UI of a dropdown-1 + Array(dropdown-2 + text field+text-field) where in array's text-field depend on value of dropdown-1, I cannot create the same UI in active choice.
Does any one know how options.dependencies could work in jenkins or same could be achieved using watch/other plugins?
if i got your question right, so you want to make it more smart way to select parameters.
So you can do it via groovy script.
Here is my example you can see on pic:
freestyle job config
Sorry, but i don't know how to better show freestyle job config.
So, logic is quite simple:
i'm collecting JSON on first parameter, and doing some parsing for it.
and then im using Environmets variable to show it's contents, depending on result from first part.
ps. i'm struggling right now with variable Hosts, as i don't know how to pass it in final steps without asking user for input.
But i believe you got the idea how you can do it.

Pre-setting values to Docusign template

I am new to Docusign api and I am trying to post values from my form into a template. To be honest, I am not sure if I even created the custom fields properly or if there is some special way to set them into the form other than just creating a text field with a name.
I have read through the docs and recipes and about a dozen or more stack posts.
I am using rails and my fields post just fine but it's my tabs that do not. I read somewhere that I am supposed to use tabs and not custom_fields. Not sure if that's totally correct but that's how I've interpreted it.
Here is my current code:
body: {
"emailSubject": "DocuSign API call - Request Signature - Boom",
"templateId": "e1d5bce1-9757-4ffe-881b-054aa9139f2f",
"templateRoles": [{
"email": "#{renter.email}",
"name": "#{renter.background.legal_name}",
"roleName": "Lessee"
},{
"email": "#{#manager.email}",
"name": "#{#manager.name}",
"roleName": "Lessor",
"tabs": {
"texttabs": [{
"tabLabel": "Rent",
"value": "#{#lease.rent}"
},{
"tabLabel": "Address",
"value": "987 apple lane"
}]
}
}],
"status": "sent"
}.to_json
baseUrl that I am sending to:
"https://demo.docusign.net/restapi/v2/accounts/my_id/envelopes"
In your texttabs section, you should be passing in the following parameters at a minimum per tab: tablabel & value.
tablabel is the name of the tab that you have defined on the template. So from what I can tell, you have a text box on your template called Address. So you should put "tablabel":"Address".
value is what you would like to pre-populate in the tab. Looks like you have that correct.
You do not want to use tabID as that is not a valid parameter in this flow. The API documentation details what parameters you can use: https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#REST%20API%20References/Tabs/Text%20Tab.htm?Highlight=data%20tab
I also see an extraneous parameter of "Rent" under templateRoles section. That value will be ignored since it is not a valid parameter.
Turns out the problem was not with the code but with the setup within docusign. Make sure that you are setting up your tabs correctly and if you want to replicate a field multiple times make sure that they all share the same exact name.

Creating json from array

I'm converting model query results to json and send them to selection box with
MyModel.find(params[:id]).my_sub_models.map(&:attributes)
I'm displaying my_sub_model :name(s) in selection box. Thats ok.
Later i added a column(:label) to sub model and i want to display a combined text in selection box like :name-:label. So i created a method
def combined_name
self.name + "-" + self.label
end
How can i add combine_name for each item into my json now?
Any idea? Thanks
To include any methods on the model, use :methods.
my_model.to_json(:methods => :combined_name)
# => {"id": 1, "name": "My Name", "label": "Label",
"created_at": "2012/02/01", "combined_name": "My Name - Label"}
Reference: API Doc.
Update:
to_json method of ActiveRecord was deprecated after 2.3.8. You probably are using Rails 3. A similar question was asked sometime back here and the responses might help you here. Especially about the gem acts_as_api. Do check.
Have u tried collect?
MyModel.find(params[:id]).my_sub_models.collect { |sub_model| [ submodel.id, submodel.combined_name ] }
This way you will send only id and the name, that you will need for your select box.

Resources