We are experiencing an issue with Aspose.Cells Smart Markers while trying to generate row indices for a table that does not include a header value for Index. Additionally, there is a structural gap (one or more columns) between the index column and the actual data columns. In this scenario, the row index is not being generated as expected.
Outputs.zip (18.3 KB)
We have reviewed the documentation but could not find guidance that addresses this specific use case. To help reproduce the issue, we have attached a sample program along with both the actual and expected outputs.
AsposeCellTester.zip (35.8 KB)
@geetha123
It sounds like you’re encountering a challenge with Aspose.Cells Smart Markers when trying to generate row indices for a table that lacks a header and has a gap between the index column and the data columns. This can complicate the indexing process.
Cause: The absence of a header and the presence of empty columns between the index and data columns can disrupt the Smart Marker functionality.
Solution: Here’s a step-by-step approach to troubleshoot and resolve the issue:
-
Check Smart Marker Syntax: Ensure that your Smart Marker syntax is correctly set up. The syntax should properly reference the data you want to display, even with gaps between the index and data columns.
-
Adjust Data Range: Make sure that your data range in the Smart Marker is correctly defined to include all relevant columns. Explicitly specify the range to ensure that the Smart Marker can correctly identify the data.
-
Use Custom Indexing: If the default indexing does not work due to the absence of a header, implement a custom indexing mechanism. Manually set the index values in your code based on the data rows.
-
Review Sample Code: If you have a sample program, review it to ensure that the logic for handling the index and data columns is correctly implemented. Sharing relevant parts of your code can provide more specific guidance.
-
Test with Simplified Data: Create a simplified version of your data without gaps and headers to see if the Smart Markers work as expected. This can help isolate whether the issue is with the data structure or the Smart Marker configuration.
Next Steps: If you can provide more details about your implementation or share specific code snippets, I’d be happy to assist you further.
Thank you for reaching out, and I look forward to helping you resolve this issue!
@geetha123,
Thank you for sharing the template XLSX file and sample app.
I tested the sample app using the provided resource files (template XLSX and JSON data file) and observed the same output/issue as reflected in the generated XLSX file you shared. We will need to carefully evaluate whether this is indeed an issue, the expected behavior or something else. 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-46442
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.
@geetha123
orders.zip (23.1 KB)
We have fixed this issue. The fix will be included into the next version 25.8.
Please check the “OrderTemplate.xlsx”, you can change dynamic smart marker formulas to normal formulas.
And there are two improvement in the next version:
- We supported range parameter of smart marker.
- For the method WorkbookDesigner.SetJsonDataSource(string name,string json), the parameter “name” could be null, then you do not need to split json by yourself.
The issues you have found earlier (filed as CELLSJAVA-46442) have been fixed in Aspose.Cells for Java 25.8.
Hi, as I can see in output shared, rowIndex is still not generated, the ask was about to generate rowIndex dynamically like attached screenshot based on row which is not having header,
image.png (12.7 KB)
@geetha123,
I tested your scenario/case using your application with latest version (Aspose.Cells for Java v25.8) using the updated template Excel files (we provided in the previous post). It seems we only fixed the issue about column gaps for data and did not address the issue where you need to generate rowIndex dynamically like your attached screenshot based on rows which is not having header.
You should have told us about row indices not being added, when we provided the sample files in our previous reply.
Anyways, we will evaluate it further and get back to you soon.
I have missed the updates on this ticket, checked recently and evaluated, Thanks to evaluating further.
@geetha123,
Alright, since this is your custom needs, you may simply workaround it to accomplish the task (paste row indices dynamically) via dynamic (Smart Marker) formulas. Please see and try the attached sample template XLSX file with your original code and JSON data file, it will work as per your needs for inserting row indexes for the underlying JSON records. Moreover, you may also add row index values to specified G column cells manually via Cell.putValue() or Cell.setFormula() method after you have processed markers and data is filled into the relevant cells of the tables.
OrderTemplate1.zip (7.5 KB)
Hope, this helps a bit.