Free Support Forum - aspose.com

How to use the smart markers with merged cell?

I searched and found that you have already support using smart markers with merged cell in the topic Using SmartMarkers in merged cells?, but how to use the feature ?

@xuanniao,

Thanks for your query.

By using Smart Markers with merged cells means Aspose.Cells would make the (column) cells merged if the starting cell (that contains the Smart Marker) is a merged one. Do you find any issue? Kindly create a sample console application, zip the project and post us with template, we will check it soon. Please use dynamic dataset/data table in code to remove any inter dependencies for external data source so we could execute your code seamlessly to consequently figure it out soon.

PS. please try our latest version/fix: Aspose.Cells v20.4 if you are not already using it.

I have changed to v20.4, but still only the first cell merged, others not.exnpand_input.jpeg (66.6 KB)
expand_output.jpeg (77.7 KB)

@xuanniao,

Please do not use “noadd” as it will use existing cells in the column to fill data. Also, you may try to use “copystyle” attribute if it makes any difference.

The horizontal expand didn’t use noadd parameter. I tried copystyle, the horizontal expand still only the first cell merged, the vertical expand merged 301 rows and only had the first value.horizotal.jpeg (139.7 KB)
vertical.jpeg (129.4 KB)

@xuanniao,

Thanks for the screenshots.

Could you provide a sample console application (runnable), zip the project with template file and output file to show the issue, we will check it soon. Please use dynamic dataset/datatable in code to remove any inter dependencies with external data source, so we could execute your project seamlessly to consequently figure it out soon.

mergeCellExpand.zip (92.4 KB)
Here is the sample files. Thank you very much!

@xuanniao,

Thanks for the sample code and files.

We will evaluate your issue and get back to you soon.

@xuanniao,

I am able to reproduce the issue as you mentioned. I tested in a simple scenario using a template file (attached) which contains two markers (one vertical and other is horizontal) into merged cells. I found the issues:

  1. For vertical merged cell marker, it actually inserts all the data into respective cells in that column but finally merges the whole sets of cells to make it one. Consequently it shows the first value for the big merged cell.

  2. For horizontal merged smart marker cell, it again skips merging respective cells in the row. It actually merges first two values to make one cell and then inserts rest values into alternative cells in that row.

In both cases, it does not work as expected and data is also is missing especially for vertical markers. But again if you unmerges the merges cell(s) in MS Excel manually (in the output file), you will see all the values and find Aspose.Cells actually inserts the values fine but does not apply formatting (merge cells, etc.) of the Smart Markers cell.

I used the following sample code with a simple template file in the zipped archive(attached):
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\smsample12.xlsx");
        WorkbookDesigner designer = new WorkbookDesigner();
        designer.setWorkbook(workbook);
        designer.setDataSource("VariableArray1", new String[] { "TEst", "Test2", "TEST3", "TEST4" });
        designer.setDataSource("VariableArray2", new String[] { "SecondTEst", "SecondTtest2", "SecondTEST3", "SecondTEST4" });
        designer.process();
        workbook.save("f:\\files\\out1.xlsx");

I have logged a ticket with an id “CELLSJAVA-43172” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.
files1.zip (13.3 KB)

Thank you! And I still have two questions about expand.

  1. How to expand text or called constant value for some columns with smart markers?
  2. Can the cell bellow field with &=[Datasource].field following the expand, the template and expected output are attached.text_expand.zip (15.4 KB)

@xuanniao,
We are working on this issue and will get back to you soon to provide our feedback.

@xuanniao,

  1. and 2)
    Those constant values are nothing to do with or have any links with/to Smart Markers, so you have to manually add these text after your smart markers are processed and data is filled horizontally into the cells in the respective row(s).

Moreover, we have fixed your issue (logged earlier as “CELLSJAVA-43172”. We will soon provide you the fixed version after performing QA and incorporating other enhancements and fixes.

When can I get the fixed version? Thank you!

@xuanniao,

The fix is not yet available for public usage. Once it is available, we will share the download link for your needs.

Don’t you have a release plan? A possible date? I want to know if we can use it in our release plan for feature based it. When our feature is to be released, we will purchase your license.

@xuanniao,

Please try our latest version/fix: Aspose.Cells for Java v20.4.5 (attached)

Your issue should be fixed in it as we tested your scenario with the attached (latest) fix.

Let us know your feedback.
aspose-cells-20.4.5-java.zip (7.1 MB)

I have tried, it works. When used with noadd parameter, it need skip:n parameter.Thank you!

@xuanniao,

Good to know that your issue is resolved by the new fix/version.

Please note, when using only “noadd” parameter in the markers (which are inserted in some merged cells), it will not work and rightly so. The reason is since some cells in range are already merged so you cannot further merge the existing merged range of cells. For your needs whenever you need to use noadd parameter (for those markers in merged cells), you will also need to include “skip:n” parameter when defining the markers. See the sample example for your reference:
&=$VariableArray1(copystyle, noadd, skip:1)

Access to the source data in an report is a powerful feature which opens new ways to utilize a report in effects, both for reporting and calculation purposes. Combined with the lookup functions in Excel, you can define customer tailored reports, such as financial statements which require a more complex layout UPSers

@Mendozas,

Is there any thing we can help you with using Aspose.Cells APIs? Please elaborate your query a bit and provide more details, so we understand you better and help you through.