Hi,
in this example:
https://github.com/jxlsteam/jxls/blob/master/jxls-poi/src/test/java/org/jxls/examples/stress/SxssfDemo.java
, method: simpleSxssf()
I am trying to support grouping similar to the jxls1 grouping feature.
So I changed the example to print the age and set age to 30 or 40:
public static Employee generateOne(String nameSuffix, int counter){
return new Employee("Employee " + nameSuffix, (counter % 2 == 0? 30: 40 ), 1000 + random.nextDouble()*5000, random.nextInt(100)/100.0d, new Date(current - (1000000 + random.nextInt(1000000))));
}
public static List<Employee> generate(int num){
List<Employee> result = new ArrayList<Employee>();
int counter = 0;
for(int index = 0; index < num; index++){
result.add( generateOne("" + index, counter) );
counter++;
}
return result;
}
In my template (attached), you see that the total sums are being calculated with a workaround:
=SUMMEWENN(A:A;"Employee*";E:E)
In english:
=SUMIF(A:A,"Employee*",E:E)
But in the calculation of the group sums, this workaround doesn't work, since Excel does not accept this:
=SUMMEWENN(B:E;${_group.item.age};E:E)
In english:
=SUMIF(B:E,${_group.item.age},E:E)
The problem is in the ${_group.item.age} construct.
If I make this a text, just to check if jxls is replacing ${_group.item.age} with the correct text:
'SUMMEWENN(B:E;${_group.item.age};E:E)
in english:
'SUMIF(B:E,${_group.item.age},E:E)
I see in the result that the correct values are being replaced!
'SUMMEWENN(B:E;30;E:E)
and
The only part missing is to make this text a formula:
=SUMMEWENN(B:E;30;E:E)
and
Is this possible in jxls2 ? It is almost working, it is just this syntax that Excel does not understand. Is there any other syntax for ${_group.item.age} that would work ? Or is this a bug?
sxssf_template.xlsx