In the meantime, we will evaluate your original requirements and try to support variables in Excel template for smart marker. 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): CELLSNET-58593
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.
@sagaofsilence.dev 20250618.zip (9.0 KB)
We made some changes in variables worksheet.
1,Type column represents the type of Variable.
2,{} represents a Variable is referred in Expression Variable because the name of columns will contains specific characters such as space , quotation mark, and so on.
@sagaofsilence.dev
Please check files in vmarker.zip (17.6 KB)
which is generated with the following codes and inner hot fix :
Workbook workbook = new Workbook(dir + “vmarker.xlsx”);
WorkbookDesigner workbookDesigner = new WorkbookDesigner(workbook);
workbookDesigner.ContainsVariables = true; // Indicates whether containing variables.
workbookDesigner.SetJsonDataSource(“Company”, File.ReadAllText(dir + “test.json”));
workbookDesigner.Process();
workbook.Save(dir + “dest.xlsx”);
Note: the Expression must follow the rule of formulas of MS Excel. For Example : In MS Excel , “+” only works for number value, if you want to join the string , please use “&” or CONCAT function .
The issues you have found earlier (filed as CELLSNET-58593) have been fixed in this update. This message was posted using Bugs notification tool by leoluo
Scope
Do you mean there will be same Variable Name in different scope? Answer: Yes, the user can declare the same variable name for the different worksheets. This could be intentional and a well-considered decision.
message Hello World
We think all data are from WorkbookDesigner.SetDataSource(), so we should not set value of variable in the template. It’s better that there is only definition in the template file, otherwise it will confuse. Answer: You can use hand-coded data in the template as you wish.,The data may vary from one template to another, and different customers might use different data for the same type of template.
message2 message + “-xxx”
All data such as message-1, message-2, message-3 and so on in the data source should be processed as message2. Answer: The calculated data may not be included in the system-generated JSON payload, so users can create the calculated data from the basic/atomic data in the JSON payload.
Could you post a data source file and Expected result file?
And, you can add more expected variable definitions in the template files, then we can better understand your needs. Answer: I have attached the sample data company.zip (380 Bytes), which can be referred to for the variables declared in the examples. Please note that the examples provided are hypothetical. When writing complex expressions, declaring and reusing variables becomes an important feature.
It seems that we cannot support “if … else…”. Answer: Our users need this feature. When users compare the Word template to the Excel template to achieve the same output, the Excel template does not support the conditional inclusion of sections or changing the cell value conditionally. In Excel, it’s not possible to add expressions into the IF formula; the formula only accepts cell references and values recognized by Excel formulae.
I note that CELLSNET-58593 is mentioned in the release notes for Aspose Cells .NET version 25.7 but not for Aspose Cells Java. We need variable support in Java.
Yes, the ticket was originally logged in .NET. Please note that the fixes and enhancements have also been incorporated into the Java version simultaneously, as the Java version is ported from the .NET codebase. We recommend trying the latest available version of Aspose.Cells for Java v23.7.
Feel free to reach out if you encounter any issues.
Now you can define Tax rate as an Expression in variables worksheet as “Message2”.
And we are thinking about whether we can directly process it as an Expression .
The smart marker like : &=&=if({product.Code}== “IMPORTED”,0.3,0.1)~(Expression)
We have to add an “IF” or “Condition” smart marker to support this feature.
&=product.Name(IF:product.Code == "IMPORTED“)
As parentheses represent starting and ending parameters, so will you use complex condition in the “IF”?
Given our multi-tenant SaaS environment, where template designs and user needs vary significantly across different domains, the complexity of conditional expressions will likewise differ. We aim to implement a conditional expressions feature that closely mimics the functionality of Word’s <<if>> tag. This feature should ideally control either a single cell smart marker or a specified range of cells containing smart markers. I will prepare and share a sample template for further illustration shortly.
Thank you for providing additional details regarding your requirements and outlining your desired conditional expressions. We will carefully review the information and respond with our evaluation soon.
@sagaofsilence.dev
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): CELLSNET-58756
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.
@sagaofsilence.dev
Thank you for your feedback. You are welcome. This is to inform you that your issue (logged earlier as “CELLSNET-58756”) has been resolved. The fix/enhancement will be included in an upcoming release (Aspose.Cells v25.8) that we plan to release in the first half of August 2025. You will be notified when the next version is released.
The issues you have found earlier (filed as CELLSNET-58756) have been fixed in this update. This message was posted using Bugs notification tool by leoluo