Border thickness lost when specifying PrintArea to SheetRender

Hello,

We identified an issue with SheetRender when specifying what part of the worksheet to print.

I’ve attached a small console application describing the issue. When specifying the B2:B4 print area, the last cell is being printed with a smaller bottom border than it should be. You can check the 2 pictures as the console application is generating.

We are using Aspose.Cells version 8.0.2.0.

Any feedback will be highly appreciated.

Thank you in advance,
Mihai Andrei
Senior Software Engineer
IBM Romania

Hi Mihai,


Thank you for contacting Aspose support.

We are able to replicate the presented behavior while using the latest version of Aspose.Cells for .NET 8.1.0.2. We don’t think this behavior as a bug on the part of Aspose.Cells for .NET API. Reason being, the border is part of two consecutive cells sharing it, therefore when you specify the Print Area between the two cells sharing the border, the border is cut into half.

Anyway, we have logged an investigative ticket (CELLSNET-42767) to dig deep into this issue. Please spare us little time for thorough analysis. In the meanwhile, we will keep you posted with updates in this regard.

Hi Mihai,

Thanks for using Aspose.Cells.

We have looked into this issue further. It is because of the OnlyArea set in ImageOrPrintOptions, it will make only Area to be output (with no margins). But the bottom thick border needs to extend some
beyond the cell area.


A solution is to extend the printArea. e.g. B2:B5

Hello,

If we are to generate this with OnlyArea = false, the bottom border is still thinner than it should be.

Here is the following code used to reproduce this issue, along with the attached file:
--------------------------
var workbook = new Workbook(“testFile.xlsx”);
var worksheet = workbook.Worksheets[“Sheet1”];

worksheet.PageSetup.PrintArea = “A1:B3”;

var sheetRender = new SheetRender(worksheet, new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = false
});

sheetRender.ToImage(0, @“out.png”);
--------------------------

Observe the differences between this image and the original.

InternalId: 13024

Best regards,
Jean-Alexandru Stanescu
Junior Developer
IBM Romania

Hi,

Thanks for your posting and using Aspose.Cells.

Could you set the print area to “A1:B4”, then it outputs the correct image. I have attached the output image for your reference.

Hello,

No, I cannot extend the area with one more row. Isn’t ‘OnlyArea’ supposed to allow printing of borders that extend into the other cell outside the print area?

Best regards,
Jean-Alexandru Stanescu
Junior Developer
IBM Romania

Hi,

Thanks for your logical opinion and using Aspose.Cells.

Your argument is valid. However, there might be some repercussions we might be ignoring. We can replicate this issue with the latest version too.

We have therefore logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-44025 - Border thickness is not preserved as per Print Area

Hi,

Thanks for using Aspose.Cells.

‘OnlyArea’ only outputs the cell area. Half of the thick border is out of cell area (see screenshot in attachement)) . If you want same width thick border, the thick bottom border of last row must be moved up, but it is not reasonable.



Because the bottom margin is zero in the user’s file, so even ‘OnlyArea’ is false, it got the same result. If the bottom margin is not zero, the bottom thick border will be better.

Hello,

Exactly. ‘OnlyArea’ should output the cell area when set to true. Thus, setting it to false should allow us to output the thick border as well. I have tried modifying the bottom border value as you said. Even if it would be an accepted workaround, it is to no use since the borders still have different sizes.

-------------
var workbook = new Workbook(“testFile.xlsx”);
var worksheet = workbook.Worksheets[“Sheet1”];

worksheet.PageSetup.PrintArea = “A1:B3”;
worksheet.PageSetup.BottomMargin = 5;

var sheetRender = new SheetRender(worksheet, new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = false
});

sheetRender.ToImage(0, @“out.png”);
-------------

Best regards,
Jean-Alexandru Stanescu
Junior Developer
IBM Romania

Hi,

Thanks for your feedback, sample code and using Aspose.Cells.

We were able to observe this issue and found that bottom border thickness is still not correct even though bottom margin has been set to 5.

We have logged your comment, screenshot and sample code in our database against this issue for product team consideration. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

Hi,

Thanks for using Aspose.Cells.

This is to inform you that we have fixed your issue CELLSNET-44025 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

Hi,

Thanks for your using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for .NET v8.6.1.2 and let us know your feedback.

Code:
var workbook = new Workbook("testFile.xlsx");
var worksheet = workbook.Worksheets["Sheet1"];

worksheet.PageSetup.PrintArea = "A1:B3";
worksheet.PageSetup.BottomMargin = 5;

var sheetRender = new SheetRender(worksheet, new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ImageFormat = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = false
});

sheetRender.ToImage(0, @"out.png");

The issues you have found earlier (filed as CELLSNET-44025) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.