This tip and trick started based on the requirement of the following post.
With this tip you can show Red , Yellow , Green ( and other ) status in color in reports created through templates.
The tip is inspired by previous tips by @Fabian_Weller
https://www.googlecloudcommunity.com/gc/Feature-Ideas/Customize-TEXT-ICON/idi-p/323786
and @Koichi_Tsuji
and similar others
Basically to show the red, yellow , grren status one uses these palceholder images based on status.
The app formula for the thumbnail type color image column [StatusCMonth] in the example is something like
CONCATENATE("https://placehold.jp/",SWITCH([Current Month],"Red","ff0000","Green","228C22","Yellow","FFCC00","000000"),"/ffffff/150x150.png?text=",[Current Month])
Please change the SWITCH() expression to suitably modify the expression as per your requirement, of "red", "Yellow", :Green" status requirements. The thread below shows teh status for various risk values.
For [StatusPmonth], replace [Current Month] with [Previous Month] in the above expression.
Here based on status of the [Current Month] or [Previous Month] column a hex color code value for the placeholder image is chosen. The backend data looks like somethibg below
The report output looks like something below
Hi, thanks for all your efforts.
I'm afraid I don't understand how this helps. I want to have a rule like this:
For values of Risk...
1 - 4 - show (cell background) Green with the number visible
5 - 10 - show Yellow with the number visible
11+ - show Red with the number visible
Are you suggesting I create a graphic for each number with the appropriate colour and then load that exact graphic?
thanks
James
You will obviously need to change the concatenate expression a bit to match your requirement. Since I was unware of your exact requirement , I shared a general expression that you can easily modify . I have modified it as below.
The modified expression will now create the images with colors and risk values embedded therein as per your shared requirement.
The column [Risk Value] is number type and consists of risk values and the column [StatusCMonth] is Thumbnail type, with the concatenate expression as app formula as given below.
CONCATENATE("https://placehold.jp/",
IFS([Risk Value]<=4 ,"228C22",
[Risk Value]<=10 , "FFCC00",
[Risk Value]>10,"ff0000"),
,"/ffffff/150x150.png?text=",[Risk Value])
The report now looks like below
Gosh, that's impressive, many thanks for the solution!
Where do I place the Concatenate expression, just in the table box?
You will put it in the column of thumbnail type. The column will create those images based on risk value column.
You can create report template to include only thumbnail type column, because it has risk value included along with the status color image.
Hope this explains. Please do revert if you have any more query. The report template of the report image I shared above alooks like below. [StatusCMonth] is the column that has the concatenate expression and then creates those status color images with risk value embedded.
Sorry, I'm totally lost now.
When you refer to 'types' for columns, do you mean in the App?
So the Concatenate expression goes in the App someplace?
I tried loading it in the cell box and it just prints out the whole expression in the PDF. If I enclosed the Concatenate statement in the << and >> tags, it doesn't work at all. How do I deploy it please?
thanks
James
please share your column and report template. As shared in all the posts above the CONCATENATE() expression needs to be in the column. The template should simply have the column name.
Ah OK - in the Formula box of the Column in the App?
Yes. App formula box.
This is my Hazard table. The three risk factors are Factor 1, Factor 2 and the result, Factor 3, is 1 multiplied with 2. Factor 3 is the one I want to output in the appropriate colour. The formula box therefore multiplies them. Do I need to create another column for the thumbnail that copies that and contains your Concatenate formula?
@JamesWB wrote:Do I need to create another column for the thumbnail that copies that and contains your Concatenate formula?
Yes, please create another thumbnail type column with the app formula.
CONCATENATE("https://placehold.jp/",
IFS([Factor 3]<=4 ,"228C22",
[Factor 3]<=10 , "FFCC00",
[Factor 3]>10,"ff0000"),,"/ffffff/150x150.png?text=",[Factor 3])
Yes, please create another thumbnail column with a CONCATENATE() formula. Please include that column name in the template as <<[Thumbnail Column Name]>>
Absolutely brilliant, I'm very impressed, thank you.
Great. Good to know finally it works. If you wish you could reduce the size of those colour boxes ( if those are looking a bit too big) with an expression as below
CONCATENATE("https://placehold.jp/",
IFS([Factor 3]<=4 ,"228C22",
[Factor 3]<=10 , "FFCC00",
[Factor 3]>10,"ff0000"),
,"/ffffff/100x100.png?text=",[Factor 3])
Finally please be aware that the images are created by a third party service.
Thanks. I guess I would have to find a different thumbnail generator if they disappear! Really neat though, I was tearing my hair out over this as it is business-critical to have it. I've marked it as a Solution on the original thread. Have a great day and many thanks.
James
Hi @Suvrutt_Gurjar , very nice ! Do you know how to avoid this corner blur when using border-radius CSS parameter?
Please try using image type as jpg
Perfect ! Thanks !
I am trying to do something like this but to Yes or No question prompts. I am a bit confused on whether I need to add a table with the parameters like you have here?
I have responded to your question in detail.
Outputting "Yes" and "no" responses to PDF - Google Cloud Community