JXLS在每个命令中使用if-command时丢失行

使用的版本
poi:3.15
jxls:2.4.0
jxls-poi:1.0.12

这是一个模板,可以简单地重现问题。
请注意,我正在使用JXLS的多页function。

if条件为真(站点有地址)时,结果按预期显示
但是当它是假的,没有地址显示,我失去了2行,数字7和8,取而代之的空白行。
结果

任何人都已经遇到这样的问题? 我在使用JXLS创build表单的过程中犯了一个错误吗?

public class Test { public static void main(String[] args) throws Exception { String first = "Bob"; String last = "John"; String phone = ""; List<Person> personList = new ArrayList<>(); for (int i=1 ; i<10 ; i++) { personList.add(new Person(first + i, last + i, phone + i)); } List<Site> mySites = new ArrayList<>(); Site site = new Site("site 1", "Paris", "", "rue 1", "rue 2", personList); mySites.add(site); site = new Site("site 2", "", "Bob", "", "", personList); mySites.add(site); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); InputStream template = null; if (contextClassLoader != null) { template = contextClassLoader.getResourceAsStream("test1.xls"); } OutputStream os = new BufferedOutputStream(new FileOutputStream("c:/temp/res.xls")); org.jxls.common.Context contextData = PoiTransformer.createInitialContext(); Map<String, Object> beansData = new HashMap<>(); List<String> sheetNames = Arrays.asList("site1","site2"); beansData.put("mySites", mySites); beansData.put("sheetNames", sheetNames); for (Map.Entry<String, Object> entry : beansData.entrySet()) { contextData.putVar(entry.getKey(), entry.getValue()); } JxlsHelper.getInstance().setUseFastFormulaProcessor(false).processTemplate(template, os, contextData); template.close(); os.flush(); os.close(); } 

}

问候,

这个问题现在已经解决了,下一个Jxls发行版本v2.4.1中会解决这个问题。

请参阅issue#77 JXLS在每个命令中使用if-command时丢失行以获取更多详细信息。