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

Free Support Forum - aspose.com

Header Footer Errorring

Hi!
We have a problem about saving xlsx file with converting headerfooter.
I attached original file and erroring file.
Our customer has a this problem. But we can’t catch the problem at our system.
Our customer, why might has this problem ?
Could you please check it ?

Hi,

Thanks for the template files.

Could you please try our latest version/fix if it makes any difference.

Aspose.Cells for .NET (Latest Version)

Also, I am afraid, we might not evaluate your issue properly (based on template (error) file) as we need to reproduce the issue on our end for thorough analysis. So, kindly do create a simple sample console application (runnable), zip it and post us here with all the resource files, we will check it soon. If we found the issue, we will log a ticket for it into our database.

Thank you.

Hi,

We use aspose cells 17.4.1.0 version. But the same problem continues.
We are adding 5 line headers and 1 line footer when converting this document.

Using Functions
Aspose.Cells.PageSetup.SetHeader
Aspose.Cells.PageSetup.SetFooter .


Could you please check it.

Hi,


We are sorry that you still find this issue. But as I requested you earlier unless we have your sample application (with your exact code and data for adding that erroneous header/footer to the worksheet), we might not evaluate your issue properly. We got to reproduce the issue on our end for thorough analysis and investigation of your issue. So, we appreciate if you could create a separate sample console application (runnable), zip it and post us here with all the resource files, we will check it soon.

Thank you.

Hi,

We write the following data in the header part.

Left

&“Arial” &10

&“0” &0

&“0” &0

&“0” &0

&“0” &0

Bottom

&“Arial” &10 PINAR ENTEGRE ET VE UN SAN. A.Ş.

&“Arial” &10 MCD DANA KUZU HAMBURGER KÖFTESİ ( 7:1 ) ÜRETİM KONTROL FORMU

&“0” &0

&“0” &0

&“0” &0

Right

&8 Dok. Kodu: MCD.K.F.014

&8 Rev. No: 1

&8 Rev. Tar: 1.10.2015 16:54:30

&8 Hazırlama Tarihi: 1.10.2015 16:54:30

&8 Sayfa No: 1

But we take this error.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

error109720_02.xmlErrors were detected in file ’http://qdmsv515.bimser.local/QDMSFiles/TEMPFOL/[ POLITIKA-0063 ] 34a8147f-5182-405f-aa6a-4fe01897f459 [ POLITIKA-0063_0.xlsx ] [ 0 ].xlsx’Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded.Removed Records: Worksheet properties from /xl/worksheets/sheet1.xml part

Our code is:

for (int i = 0; i < 3; i++)

{

Aspose.Cells.PageSetup pageSetup = sheet.PageSetup;

pageSetup.SetHeader(i, yazılacakbilgi);

}

logo insert code :

sheet.PageSetup.SetHeaderPicture(j, buffer);

sheet.PageSetup.SetHeader(j, “&G”);

We are waiting for your solution.

Thanks.

Hi,


Thanks for the sample file.

Please see the following sample code for your reference. I have tested with your template file (“original.xlsx”) using our latest version/fix: Aspose.Cells for .NET v17.5.x, it works fine and as expected. I do not find any error when opening the output file into MS Excel. Also the headers are properly placed as per your expected file. I used a simple image (.jpg) file for left header’s pic:
e.g
Sample code:

Workbook wb = new Workbook(“e:\test2\original.xlsx”);

Worksheet ws = wb.Worksheets[0];

PageSetup ps = ws.PageSetup;


string path = @“E:\test2\pic1.jpg”;

FileStream inFile = new System.IO.FileStream(path, System.IO.FileMode.Open, System.IO.FileAccess.Read);

byte[] binaryData = new Byte[inFile.Length];

long bytesRead = inFile.Read(binaryData, 0, (int)inFile.Length);

ps.SetHeaderPicture(0, binaryData);

ps.SetHeader(0, “&G”);

ps.SetHeader(1, “PINAR ENTEGRE ET VE UN SAN. A.S.\nMCD DANA KUZU HAMBURGER KÖFTESI ( 7:1 ) ÜRETIM KONTROL FORMU&“0,Regular” &1”);

ps.SetHeader(2, “&8 Dok. Kodu: MCD.K.F.014\nRev. No: 1\nRev. Tar: 1.10.2015\nHazirlama Tarihi: 1.10.2015\nSayfa No: 1”);

wb.Save(“e:\test2\out1.xlsx”);

Let us know if you still find any issue.

Thank you.