Setting up a border creates new vertical page break in .NET

i have three columns in the worksheet, and i’m setting borders of three cells, lets say A22,B22,C22

using the following code, when i do this it creates new page on right side. ( i guess thats vertical page break)
style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;

Hi,

Thanks for your posting and using Aspose.Cells for .NET.

We have tested your issue with the following code and did not find any issue. Please download and use the latest version: Aspose.Cells
for .NET v7.6.0.6
and see if it resolves your issue.

We have attached the output file generated by this code for your reference. If your issue still persist, then please provide us your runnable sample code and the output file to look into this issue. We will investigate it and help you asap.

C#


Workbook workbook = new Workbook();


Worksheet worksheet = workbook.Worksheets[0];


Style style = workbook.CreateStyle();

style.Borders[BorderType.LeftBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.RightBorder].LineStyle = CellBorderType.Thin;

style.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;


Cell a22 = worksheet.Cells[“A22”];

Cell b22 = worksheet.Cells[“B22”];

Cell c22 = worksheet.Cells[“C22”];


a22.SetStyle(style);

b22.SetStyle(style);

c22.SetStyle(style);


workbook.Save(“output.xlsx”, SaveFormat.Xlsx);


after carefully checking it looks like when i set right border for Cell C22, it also sets left order for D22 ( the common border for C & D) and that why its creating new page on right side


How do i fix that?
The cell i mentioned above is just an example

Hi,

Thanks for your posting and using Aspose.Cells.

Since borders are shared, so when you will set the right border of the cell C22, it will automatically set the left border of cell D22. So it is a correct behavior. It should not create a new page.

Please provide us your sample code and the output file so that we could look into this issue further.