简体   繁体   English

JXLS-为空白单元格添加公式,公式会消失

[英]JXLS - add formula for blank cells, formula just disappears

I created a report with JXLS and an excel template. 我用JXLS和一个excel模板创建了一个报告。 I have a bunch of cells/columns pulling data from my database, then I have a few columns that are blank, and then I have some formulas/conditionals in a few columns in my report as well. 我有一堆单元格/列从数据库中提取数据,然后有几列为空白,然后在报告的几列中也有一些公式/条件。 The issue I am having is that one of the formulas, needs to run/ multiply two blank columns (someone will download the report and input the numbers manually in those blank columns), and when I run the generate the report through my Java app, the column with the formula comes up as =0. 我遇到的问题是其中一个公式需要运行/乘以两个空白列(有人将下载报告并在这些空白列中手动输入数字),并且当我通过Java应用运行生成报告时,具有公式的列显示为= 0。 Anyways to get the formula to stick, so the people manually entering the numbers in the blank columns do not have to add/input the formula themselves? 无论如何,要使公式保持不变,因此人们在空白栏中手动输入数字就不必自己添加/输入公式了吗? 在此处输入图片说明

You should get Jxls to process AC and AD cells by putting a dummy JEXL expression in there. 您应该通过在其中放置虚拟JEXL表达式来使Jxls处理ACAD单元。

The simplest way is to put ${null} into AC and AD cells in your template. 最简单的方法是将${null}放入模板的ACAD单元中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM