ClosedXML.Report icon indicating copy to clipboard operation
ClosedXML.Report copied to clipboard

Merged cells getting unmerged for nested range

Open Black-Seraphim opened this issue 3 years ago • 4 comments

As you can see in the attached image: Cells in the template are merged. After filling the Report the right part of the cells aren't merged anymore. The left parts of the table is keeping the merge settings. nested_ranged_merged_cells .

Black-Seraphim avatar Jun 19 '22 19:06 Black-Seraphim

To avoid this Problem I actually use a workaraound that adds a Dummy-Property {{item.Dummy}} that is filled with a whitespace right next to the last merges cells on the right.

Black-Seraphim avatar Jul 01 '22 07:07 Black-Seraphim

OP make sure your range includes the merged cells. Make sure it's not just A-I but A-Y. I have a similar setup to you and am not seeing this issue.

I am seeing a similar issue to this though. Merged cells BELOW the nested range in the outer range do not get their merged status pushed down with the cells. Furthermore Excel reports a corrupt data in the file, specifically merged cells.

The-MAZZTer avatar May 25 '23 23:05 The-MAZZTer

I will appreciate if you attach a template and provide some reproduction code so I could investigate the issue.

Pankraty avatar Jul 27 '23 21:07 Pankraty

Sorry, but actually I'm not involved to the project where I was using ClosedXML anymore. If I will return to this project, or use ClosedXML on another project in future, I can take the time to recreate the sample and also add the code. But to be honest, there shouldn't be much more information about. I'm just inserting variables into the report as described in the documentation. It is only affecting the last merged cells inside of a line, so I create a workaround by adding a dummy variable right of the last cells.

Black-Seraphim avatar Aug 20 '23 16:08 Black-Seraphim