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

Free Support Forum - aspose.com

.getHeader(2) doesn�t work

.getHeader(2) doesn’t work

.setHeader(2,'Test Header Right') works fine bud I can’t read that value with .getHeader(2)

I have version 4.0.1

Any Idea, or is or was there a problem in that version?

Hi,


Please upgrade to latest version of Aspose.Cells for Java v7.0.4:
http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/entry350406.aspx
We recommend you to try: Aspose.Cells for Java v7.0.4.7 This is our latest fixed version with several enhancements.

If you still find the issue with v7.0.4.7, kindly attach your template Excel file here, we will check your issue soon.

Thank you.

Downloaded the new version and tried it again, same result _textLeft, _textCenter and _textRight is null

_sheet = _workBook.getWorksheets().get(0)

_pageSetup = sheet.getPageSetup()

_textLeft = _pageSetup.getHeader(0)

_textCenter = _pageSetup.getHeader(1)

_textRight = _pageSetup.getHeader(2)

Hi,

I have tested it with the latest version and it is working fine.

Please download the latest version: Aspose.Cells for Java v7.0.4.7

Please see the code and its output below.

Java


String filePath =“F:\Shak-Data-RW\Downloads\dienstalter.xlsx”;


Workbook _workBook = new Workbook(filePath);


Worksheet sheet = _workBook.getWorksheets().get(0);


PageSetup _pageSetup = sheet.getPageSetup();


String _textLeft = _pageSetup.getHeader(0);


String _textCenter = _pageSetup.getHeader(1);


String _textRight = _pageSetup.getHeader(2);


System.out.println(_textLeft);

System.out.println(_textCenter);

System.out.println(_textRight);

Output:
&L<>
&C<>
&R&P von &N