The issues you have found earlier (filed as CELLSJAVA-46470,CELLSJAVA-46472,CELLSJAVA-46473) have been fixed in Aspose.Cells for Java 25.9.
@pgcentric
We have fixed issue : CELLSJAVA-46495.
Please check attached result:
CELLSJAVA46495.zip (12.2 KB)
This fix will be included into the next version 25.10
Hi, I am trying to conditionally render materials.C$Name based on DSSection.C$Name Key,
but it renders the whole list instead of rendering values related to "if "condition. Could you please check?
conditional.zip (52.9 KB)
@pgcentric
Materials.DSSection.C$Name are brother’s sons of Materials.C$Name according to levels.
If Materials.DSSection or Materials.DSSection.C$Name is an array ( we can not simply check what Materials.DSSection.C$Name is), we do not know how to compare.
Hi, when testing IF in Cells Java smart markers, we observed that using comparison checks with <= , > , ,‘>’ etc, results in the following error.
Exception in thread “main” java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke “com.aspose.cells.t05.f(com.aspose.cells.p5g)” because “” is null
Could you please check? Thanks
if_error.zip (16.0 KB)
Thanks for the template Excel file, JSON data file and sample code snippet.
After initial testing, I am able to reproduced the issue as you mentioned. I found an exception “java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "com.aspose.cells.t05.f(com.aspose.cells.p5g)” when processing IF (using comparison checks with <= , > , ,‘>’ etc.) in smart markers.
We require thorough evaluation of the issue. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46513
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@pgcentric
I have fixed this issue. It will be included into the next version 25.10.
BTW, I would like to use “where" or “filter” to replace this “if” smart marker. Which tag do you more like?
Hi, thanks for the quick response. Could you please share the reasoning behind this change? For example, is it intended to improve readability or address any technical limitations?
Additionally, we’d like to understand how complex conditions will be handled with this tag. Will it support logical combinations such as:
Expression1 || Expression2Expression1 && Expression2- or nested conditions like
(A && B) || C?
Or if the user wants to handle complex condition, how he/she will be able to handle it in Smart Marker?
We don’t have any specific preference betweenwhereandfilter, so please feel free to use whichever option you think fits best. Thanks
@pgcentric
It’s a bug of calling calculating formulas. Some parameters were required .
It’s same as variable Expression as summary on Variables in Excel template - #72 by simon.zhao
You can use any valid Excel-like formula within them.
Hi, just to check if my understanding is correct, I tried this
&=node.books.price(if:{node.books.isAvailable} = {AND(node.books.price > 10,node.books.price < 15)})
This did not throw any error, but the expectation was that it should not print a value as the price is 20 in the payload, making
expression true = false in if, but in the output value of price got printed.
Thanks for your feedback with findings.
Your details have been recorded under the existing ticket “CELLSJAVA-46513” in our database for evaluation. Please wait for the next version, which will include all the enhancements.
@pgcentric
Please change the formula as &=node.books.price(if:{node.books.isAvailable} = AND({node.books.price} > 10,{node.books.price} < 20))
Please add curly brace for each variable。
I tested this it is throwing a runtime error. I guess this will work in 25.10, right?
Kindly wait for the release of the new version (Aspose.Cells v25.10), so you may evaluate and test your scenarios/cases with it based on our suggestions.
The issues you have found earlier (filed as CELLSJAVA-46502,CELLSJAVA-46495,CELLSJAVA-46513) have been fixed in Aspose.Cells for Java 25.10.
Hi, is the conditional smart marker limited to if clause only, or can we use else and else if clauses also? If yes, what is the syntax for that?
@pgcentric
We do not support “else if clauses”. You can use smart Expression &=&=if({node.a} == “abc”,{node.a},{node.b})
See Variables in Excel template - #71 by sagaofsilence.dev
Hi, I tried the above syntax, but facing a runtime exception
Error: Absent operand for '='(Based on cell Template!A90)
Could you please check?
dynamic_if.zip (14.2 KB)
@pgcentric
Please change the template expression to: &=&=if({node.books.price} =20,“Price is 20”,“Price is not 20”)
We can reproduce the issue by testing with the latest version v25.10 using the sample file and the following sample code. Unsupported token for Array when using if condition in smart markers.
Workbook workbook = new Workbook(filePath + "valid-template-if-condition-without-variables.xlsx");
WorkbookDesigner designer = new WorkbookDesigner();
designer.setWorkbook(workbook);
String jsonData = new String(Files.readAllBytes(Paths.get(filePath + "valid-template-if-condition-without-variables.json")));
designer.setJsonDataSource("node", jsonData);
designer.process();
designer.getWorkbook().calculateFormula();
designer.getWorkbook().save(filePath + "out_java.xlsx");
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSJAVA-46534
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@pgcentric
Currently, variables in repeated formulas are only processed if a variable worksheet is present in the template file. Therefore, as a temporary solution, please create a new variable worksheet in the template file. Please check the attachment and use the following sample code for testing. result.zip (28.3 KB)
Workbook workbook = new Workbook(filePath + "valid-template-if-condition-without-variables.xlsx");
WorkbookDesigner designer = new WorkbookDesigner();
designer.setWorkbook(workbook);
String jsonData = new String(Files.readAllBytes(Paths.get(filePath + "valid-template-if-condition-without-variables.json")));
designer.setVariablesWorksheetName("variables");
designer.setContainsVariables(true);
designer.setJsonDataSource(null, jsonData);
designer.process();
designer.getWorkbook().save(filePath + "out_java.xlsx");