Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
It seems that you will need a some sort of "rules engine sentence composer" somewhere to "think" and compose the sentences.
will contain a sentence that will change depending on the selected row. If row 1 then the text in the report will be "Today the price of banana is $1.5" If row 2 then the text in the report will be "The price of apple has gone up to $3.75"
A simple way is to write bean shell hash variable with IF-ELSEIF statements.
For example, imagine we have such pseudo function.
composeSentence( dateToday, priceYesterday, priceToday, itemName){ result = itemName; if(priceToday > priceYesterday){ result += " is more expensive than yesterday by " + (priceToday - priceYesterday) }else{ result += " is cheaper than yesterday" } return result; }
Once you have build up this, then in your report builder, you simply iterate through and keep calling the beanshell hash I suppose.
Hope this helps.
I don't think a stored record containing hash variables can be parsed.
What I could think of as a workaround is using a Form Element in the Report Builder.
Within the form, separate it by section. Each section contains the text/paragraph in Custom HTML. Use the section visibility to control which text/paragraph to display. The custom HTML would contain the text/paragraph as well as the 30 hash variables.
This requires you to pass parameters though...sorry
Hi,
I am reading this Report Builder and having a hard time figuring out how to solve my use case. Here is an example of my problem. Let's assume there is a table that contains the following
I need to create a report using report builder that will contain a sentence that will change depending on the selected row.
If row 1 then the text in the report will be "Today the price of banana is $1.5"
If row 2 then the text in the report will be "The price of apple has gone up to $3.75"
etc.
My prerequisites are :
This is just an example. In my real use case the texts will be several paragraphs and there may be more that 30 variables.
I need the variables to be replaced at run-time when the report is generated. Using hash variables I can show fruits, prices and texts independently, but I do not know how to combine them and do the replacements.
What is the best way to achieve this?