Addition operation in Excel footer

We are using a Excel file that has a footer configured like this:

Page &[Page]+1 of &[Pages]

When we print the file or save it as PDF with Office the footer renders appropriately making the addition operation. It shows: "Page 2 of 4"

But it seems that AsposeCells does not recognize the addition operation, it replaces the Page tags with current values but it does not make the addition. It shows: "Page 1+1 of 4"

This Excel file is configured like this because the "First Page Number" property of the Excel is set to 0. If we change this property to 1 and remove the addition from the footer everything works as expected.

Unfortunately these Excel files are sent to us externally and we cant alter the footers to remove the addition. Does Aspose support this Excel feature somehow?

Thanks,

Hi,


Thanks for providing us details.

After an initial test (with v8.2.0.x), I observed the issue as you mentioned by using the following sample code. The footer in the output Excel file is fine but the footer is not right in the output PDF file. It looks like an addition operation for Page tag in the Excel footer does not work well in the PDF rendering via Aspose.Cells. I have also tested your scenario/ case manually in MS Excel by placing the footer accordingly and then convert to PDF file format in Ms Excel, it works as expected.
e.g
Sample code:

Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
Cells cells = ws.Cells;
cells[0, 0].PutValue(“cell on first page”);
cells[60, 0].PutValue(“about second page”);
cells[120, 0].PutValue(“about third page”);
PageSetup ps = ws.PageSetup;
ps.SetFooter(0, “Page &P+1 of &N”);

wb.Save(“e:\test2\out2.pdf”, SaveFormat.Pdf); //Not Ok
wb.Save(“e:\test2\out1.xlsx”, SaveFormat.Xlsx); //OK


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

Once we have any update on it, we will let you know here.

Thank you.

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


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