We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Top-aligned/rotated category labels show as left-aligned in Excel but export to Image as right-aligned

Please see the chart in the attached Excel workbook (Masters.xlsx), “scores” tab. The category labels are at the top of the chart, and you see that they ‘left’ aligned (relative to their rotation). See “MastersOut.png” for the output. When I export to image, they are ‘right’ aligned (flush with the top of the slide). I have tried several different formats; and received the same result.



Can you suggest a workaround?



Sample code:

string outFile = @ … MastersOut.png

Worksheet worksheet = workbook.Worksheets[“scores”];

worksheet.PageSetup.PrintArea = “F4:O21”;

worksheet.PageSetup.LeftMargin = 0;

worksheet.PageSetup.RightMargin = 0;

worksheet.PageSetup.TopMargin = 0;

worksheet.PageSetup.BottomMargin = 0;



//Set OnePagePerSheet option as true

ImageOrPrintOptions options = new ImageOrPrintOptions();

options.OnePagePerSheet = true;

SheetRender sr = new SheetRender(worksheet, options);

sr.ToImage(0, outFile);

Hi,

Thanks for your posting and using Aspose.Cells.

We were able to observe this issue by converting your chart into image using the latest version

Aspose.Cells for .NET 8.7.0
with the following sample code. The category labels at the top of the chart are right aligned instead of left aligned.

We have 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-44192 - Category labels at the top of the chart are right aligned instead of left aligned

I have also attached the output pdf generated with this code and the screenshot highlighting the issue for a reference.

C#
string filePath = @“D:\Downloads\Masters.xlsx”;

Workbook workbook = new Workbook(filePath);

PdfSaveOptions opts = new PdfSaveOptions();
opts.OnePagePerSheet = true;

workbook.Save(filePath + “.out.pdf”, opts);

Thank you very much for the fast response; and for logging the issue.

Hi,

Thanks for your gentleness and using Aspose.Cells.

We are hopeful your issue will be fixed in a week or two. Once, the issue is resolved or we have some other update for you, we will let you know by posting in this thread. Have a good day.

Hi,

Thanks for your using Aspose.Cells.

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

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


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