template
List with numbering restart
<<foreach [ManagerTestClass m in Managers]>><<[m.getName()]>> (<<[m.getContracts().sum(c => (int)c.getPrice())]>>)
| 1. <<restartNum>><<foreach [ContractTestClass c in m.getContracts()]>><<[c.getClient().getName()]>> (<<[(int)c.getPrice()]>>)<</foreach -greedy>> |
1. <<restartNum>><<foreach [ContractTestClass c in m.getContracts()]>><<[c.getClient().getName()]>> (<<[(int)c.getPrice()]>>)
<</foreach>><</foreach>>
result
List with numbering restart
John Smith (2300000)
| 1. A Company (1200000) |
| 2. B Ltd. (750000) |
| 3. C & D (350000) |
1. A Company (1200000)
2. B Ltd. (750000)
3. C & D (350000)
Tony Anderson (1200000)
| 4. E Corp. (650000) |
| 5. F & Partners (550000) |
1. E Corp. (650000)
2. F & Partners (550000)
July James (800000)
| 6. G & Co. (350000) |
| 7. H Group (250000) |
| 8. I & Sons (100000) |
| 9. J Ent. (100000) |
1. G & Co. (350000)
2. H Group (250000)
3. I & Sons (100000)
4. J Ent. (100000)
why?
@zaze8736
It appears you are experiencing issues with the <<restartNum>>
smart marker not functioning correctly within table cells. This can occur due to how Aspose.Words processes smart markers in different contexts, particularly within tables.
Cause: The issue may stem from the table structure or the placement of the smart marker within the table.
Solution:
- Check Table Structure: Ensure that the table is correctly defined and that there are no merged cells that could affect the smart marker’s behavior.
- Marker Placement: Test placing the
<<restartNum>>
marker outside of the table or in a different cell to see if it functions as expected. This will help determine if the issue is specific to the table context.
- Update Aspose.Words: Verify that you are using the latest version of Aspose.Words, as updates often include bug fixes and enhancements related to smart markers.
- Debugging: If possible, simplify your document to isolate the issue. Create a minimal example with just the table and the smart marker to see if the problem persists.
Next Steps: If you continue to experience issues, please share a minimal code snippet or a sample document that reproduces the problem. I will be glad to assist you further.
Thank you, and I look forward to your response!
@zaze8736 Could you please attach your template and output document in DOCX format and provide your sample data source? We will test the scenario on our side and provide you more information.
@zaze8736
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): WORDSNET-28508
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.
@zaze8736 WE have completed analyzing the issue. LINQ Reporting Engine do not allow placing placeholders in the same cell before table-row data bands. Maybe in the future we will add generation of an exception for such cases.
You should try placing the restartNum
tag inside the data band and use the indexOf
function for one-time execution. Here is an example of C# code:
<<foreach [subItem in item.SubItems]>><<if [subItem.IndexOf() == 0]>><<restartNum>><</if>><<[subItem.name]>><</foreach -greedy>>
The numbering restart works correctly in this case.