Need guidance on how to achieve merged cells with smart markers

Hi, we want to achieve the following layout with merged cells using smart markers only. I have attached data, template, output, and expected output in the attachment. Could you please guide us on how this can be achieved? Thanks

layout.zip (26.1 KB)

@pgcentric

To achieve merged cells using smart markers in Aspose.Cells, you can utilize the @ symbol in your smart marker syntax to indicate that the cells should be merged. Here’s a comprehensive guide to help you through the process:

  1. Define Your Template: In your Excel template, set up the layout where you want the merged cells. Use smart markers in the cells where you want to display data.

  2. Use Smart Markers for Merging: To merge cells, you can use the following syntax:

    • For example, if you want to merge cells A1 and A2, you can place @{DataField} in A1 and leave A2 empty. This instructs Aspose.Cells to merge these cells when rendering.
  3. Data Binding: Ensure that your data source is correctly set up to provide the values for the smart markers. The data should be structured in a way that corresponds to the smart markers in your template.

  4. Rendering the Document: When you render the document using Aspose.Cells, it will automatically handle the merging of cells based on the smart markers you defined.

Here’s a simple code snippet to illustrate how you might set this up:

// Load the template file
Workbook workbook = new Workbook("template.xlsx");

// Create a new worksheet
Worksheet worksheet = workbook.getWorksheets().get(0);

// Define your data source
List<Data> dataList = new ArrayList<>();
dataList.add(new Data("Merged Value"));

// Bind the data to the smart markers
workbook.getWorksheets().get(0).getCells().importCustomObjects(dataList, true, "DataField", true);

// Save the workbook
workbook.save("output.xlsx");

Make sure to replace "DataField" with the actual field name you are using in your smart markers.

If you have specific requirements or a particular layout in mind, please provide more details, and I can offer more tailored guidance.

For further assistance, you might want to check similar discussions or examples in the Aspose.Cells documentation or forums.

@pgcentric
Please modify the template file to add the ‘group:merge’ parameter to achieve cell merging. However, after testing, there are still some issues that exist. We will fix this issue soon. Please check the attachment and refer to the following example code. matrix_modify.zip (7.9 KB)

Workbook wb = new Workbook(filePath + "matrix_modify.xlsx");
WorkbookDesigner designer = new WorkbookDesigner();
designer.Workbook = (wb);
designer.SetJsonDataSource("node", File.ReadAllText(filePath + "matrix.json"));
designer.Process(true);

wb.Save(filePath + "out_net.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): CELLSNET-59011

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.

Thank you, I had tried group:merge but it didn’t produce merged cells. I will try again once fix is available. Thanks again for quick response.

@pgcentric
Thank you for your feedback. You are welcome. We will notify you immediately once there are any updates.

@pgcentric
20250915.zip (8.3 KB)

Please check above attached file. We have supported merging =node.Hierarchy.Hierarchy.Hierarchy.Hierarchy.C$Name and =node.Hierarchy.Hierarchy.Hierarchy.Hierarchy.Code smart markers, but we can not support merging for node.Hierarchy.Hierarchy.Hierarchy.Hierarchy.ProductType.C$Name.
ProductType.C$Name and ActiveColorways.Code are under the different nodes, we can not simply process ProductType.C$Name as parent of ActiveColorways.Code