#1 2024-11-18 23:11:49

zitot
Member
Registered: 2024-10-12

dynamic color assignment in JXLS template?

-- edit: I see that there is such a thing as color picker in the admin guide, but I do not have access to it. Oh well.

Hi all,

Is it possible to make a color picking parameter which will control the highlight color of a row to work together with dynamic list and a jxls template?

(untested) The hardcoded approach I can come up with now would be a single-select datasource parameter like so:

select 'blue' as color, '#000' as hex from dual
union all
select 'red' as color, '#f00' as hex from dual
union all
..
Then in the excel template, use one jx:if statements on each line for hardcoded lines where I just paint the line the appropriate color. That would be a lot of duplicate rows but also fairly simple to pull off and visually distinct.

A practically identical approach that cuts the need for the parameter (and the variety of colors) is that I could have N templates. One for each color: Red, Green, Blue, ... Functionally the same except that you have way less UI space for that.

Ideally it'd be done programatically, where the user would pick a color in a graphical way, and jxls would somehow assign it as the highlighting color for a row.

I thought about conditional formatting but after playing around with it, I noticed the act of inserting rows was causing excel to crash so I'm scared off of it for now

Last edited by zitot (2024-12-03 20:18:55)

Offline

Board footer

Powered by FluxBB