本文介绍了在JXLS删除模板行时,输入列表是空的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JXLS填充模板的Excel US preadsheet。有时候,一个输入 - 列表 - 为空。发生这种情况时,它使用此列表中的模板字段显示在人口稠密的小号preadsheet全JXLS粉墨 - 例如, $ {someList.someValue}

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}".

有问题的领域都在单行(扩大到则为list.size()按JXLS行)。我想清楚了整排的时候有列表中没有记录。

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.

有没有办法在JXLS这样做呢?另外,任何人都可以建议使用JExcel或POI这样做互补的方式?

Is there a way to do so in JXLS? Alternatively, can anyone suggest a complementary way to use JExcel or POI to do so?

推荐答案

您可以使用< JX:如果>标签在你的Excel模板。
例如,如果您有类似以下

You can use <jx:if> tags in your excel template.For example if you have a template similar to the following

Row 1: <jx:if test="${!empty someData}">
Row 2: place holders for data that will be printed in the loop 
Row 3: </jx:if>

如果someData不空行,然后将在输出打印,但如果someData为空,则没有行会被这个模板打印。

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.

这篇关于在JXLS删除模板行时,输入列表是空的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 05:20