Issue with directly accessing nested array in Excel template

@sagaofsilence.dev
If nested smart markers layout on several rows as the following:
image.png (16.8 KB)
You have to set the defined named range “_CellsSmartMarkers” (A1:H13) which includes all markers and set LineByLine = false, then we can know how many rows should be processed together.

If you only layout smart markers on a row, you do not need to think about whether the source is nested.

While the engine successfully processes multiple tables when positioned in different rows, utilizing the _CellsSmartMarkers named range and the LineByLine=false option, a significant issue occurs when tables are located side-by-side on the same row – a common user scenario.

When we processed it without _CellsSmartMarkers and default LineByLine options (LineByLine=true ), the engine only outputs the first (leftmost) table on that row, ignoring others. Even the leftmost table is not output correctly.

This issue is demonstrated in the ‘Template17’ worksheet of the attached Excel output file.
out_employees-001-true.zip (57.0 KB)

@sagaofsilence.dev

Could you share your template file and codes? We will check them ASAP.

PFA
array range table.zip (61.9 KB)

See “Template17” worksheet in the Excel file.

@sagaofsilence.dev,

Thanks for providing template Excel file, demo (sample code) and JSON data file.

I tested using your template Excel file, JSON data and sample code. I confirmed your mentioned issue(s). I have logged the test-case with your existing ticket “CELLSJAVA-46356” into our database. We will look into it soon.

1 Like

@sagaofsilence.dev
25.4.5.zip (57.6 KB)

We only processed the worksheet “Tempate17”. But now if LineByLine is false, we do not support shift the range ,we only insert rows. So processing “List #2" reports, some empty rows were inserted into the “List #1” reports. We will try to support “Shift” smart marker when LineByLine is false, but it will be more harder to layout.
As I said in the previous post, please do not layout smart markers of two reports in one row, they will be processed together or interact.

@sagaofsilence.dev
shift.zip (57.2 KB)

I simply tried shift smart marker.
There are some issues:

  1. When inserting rows and range, we will not update the ranges in your list because we do not maintain in our model.
  2. If the range is inserted, the following tables(List #3 and List #4) will be in the different row. The whole layout will be corrupted.

Your diligent investigation of alternative solutions is greatly appreciated.

However, considering the importance of format and data integrity for controlled business documents, generating Excel file outputs is essential. These files are often utilized as proposals to clients, reports to executive management, and compliance documents.

Therefore, it is imperative that we support the designated input Excel templates and output Excel report formats as required by the business.

@sagaofsilence.dev
1,shift.zip (57.2 KB)

Please check the result with shift tag.
But List #3 and List #4 are not in the same line because the shift count of List #1 and List #2 are different.

2,We also hope that the output is consistent with your expectations.
But everyone’s expectations may be different, for example, some people expect smart makers on one line to be processed together, while you think that separated by spaces are independent reports

3, We process from top to bottom, otherwise we would need to move a large amount of data.

Thank you for your efforts in generating the Excel report from the JSON input and Excel template. While the report is appreciated, the outcome, unfortunately, doesn’t align with the expected results, and I’ve attached a screenshot of worksheet #17 with comments to highlight the specific issues.
formatting issues - 12-may-2025.png (44.7 KB)

I appreciate you pinpointing that user expectations can vary, especially concerning how “smart markers” are processed.

As our service is a multi-tenant SAAS application, template and outcome expectations differ from tenant to tenant. We aim to empower our tenants by providing them with the flexibility to design templates according to their specific needs. To achieve this, our document generation service needs to be adaptable enough to accommodate diverse template designs.

Effectively, we need to relay user intentions to the document generation engine, as tenants understand which tables should be processed together versus independently; the engine shouldn’t have to guess. Currently, we’re limited to using the “_CellsSmartMarkers” custom range name and the “LineByLine” option to define tabular data, lacking a way to specify whether multiple tables should be processed together.

I am interested in your thoughts on this: If users could indicate how tables should be processed together, would that simplify the task for the Aspose engine?

@sagaofsilence.dev,

Thanks for providing further details with screenshots.

We will thoroughly evaluate and analyze the information, and provide you with our thoughts and updates.

@sagaofsilence.dev

1,[quote=“sagaofsilence.dev, post:31, topic:307996”]
[/quote]
CELLSJAVA46356_1.zip (20.4 KB)

The two issues are caused by we would insert rows when processing smart markers without "Shift“ tag. The above attached file is generated by 25.5 with “Shift” tag.

2,[quote=“sagaofsilence.dev, post:31, topic:307996”]
lacking a way to specify whether multiple tables should be processed together
[/quote]
You can use “_CellsSmartMarkers” to include multiple adjacent tables which should be processed together.
About independently processing, I think we can add a tag(such as range ) to indicates whether we should process a range or a row. If “range” tag is set, we will end a table with empty cells, then we can know process your excepted table independently.

1 Like

Thanks for the shift tag example. While it helps with formatting and data, it doesn’t quite achieve the desired table layout, as the tables are vertically shifted by one row. The “range” tag you suggested seems like a promising solution. If it allows us to process tables on the same row independently, we could achieve the desired side-by-side arrangement for the user. Is the “range” tag currently implemented in version 25.5? If not, when can we expect its availability?

@sagaofsilence.dev,

No, current version (Aspose.Cells v25.5) does not support “range” tag. We already logged the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in support policies.
Issue ID(s): CELLSJAVA-46389 - Support smart marker range tag.

We will try to implement the feature soon. Once we have an update on it, we will let you know here.

1 Like

@amjad.sahi
25.5.6.zip (20.6 KB)

We add “currentRegion” tag to support this feature. The sheet1 is result of 25.5.6.

The results of shift and currentRegion were identical. As with shift, using currentRegion also causes the table on the right to be shifted down by one row, which is the unexpected behavior. Is there something I’m overlooking?
Comparison of shift and currentRegion tags.png (61.6 KB)

The discrepancy likely stems from the table on the left having two rows while the table on the right has three. The engine seems to be preserving the vertical spacing between the tables on the right, which results in a misalignment of one or more rows. Is there a way to prevent this behavior and achieve the layout shown in the screenshot below?
Expected outcome.png (28.0 KB)

@sagaofsilence.dev
Thank you for your feedback. We will further investigate your issue. Once there is an update, we will notify you promptly.

@sagaofsilence.dev

No, we can not support such feature. If shift or currentRegion is set, the tables on both sides are independent. We have shift the range according to the record count of data source, otherwise the data cover the table below. And because JSON is nested data source , slicer and subtotal smart marker, we can not simply count how many rows should be inserted.

Thanks for the prompt reply. I’ve noticed that the shift and currentRegion tags produce identical results. Could you clarify when it’s more appropriate to use shift instead of currentRegion?

Also, observing that the engine correctly shifts the ranges, I was wondering if providing information about which ranges should be shifted together would allow the engine to more efficiently adjust multiple ranges by the same count. This could potentially ensure that adjacent tables remain aligned on the same row, which is our desired outcome. What are your thoughts on this approach?

@sagaofsilence.dev,

Your points make sense. We will give details to differentiate b/w shift and currentRegion tags. Also, will give details on optimization process how adjacent ranges behave during expansion. We will get back to you soon.