I’m using JXLS to populate a template excel spreadsheet. Sometimes, one input – a list – is empty. When this happens, the template fields which use this list are shown in the populated spreadsheet in full JXLS regalia – eg, “${someList.someValue}“.
The fields in question are all in a single row (expanded to list.size() rows by JXLS). I want to clear the whole row when there are no records in the list.
Is there a way to do so in JXLS? Alternatively, can anyone suggest a complementary way to use JExcel or POI to do so?
You can use <jx:if> tags in your excel template.
For example if you have a template similar to the following
If someData is not empty then rows will be printed in the output but if someData is empty then no rows will be printed by this template.
I hope I could make it clear. Please see http://jxls.sourceforge.net/reference/tags.html for more information about tags.