Posted 6 June 2023, 11:22 am EST - Updated 6 June 2023, 11:27 am EST
How to get header formatting information
Posted by: gagandeep.singh on 6 June 2023, 11:22 am EST
-
-
Posted 8 June 2023, 5:12 am EST - Updated 8 June 2023, 5:17 am EST
Hi Gagandeep,
You need to use the pageHeaderFooter() method to get the text and format applied to the custom header/footer on the page.
let headerFooterInfo = sheet.printInfo().pageHeaderFooter().normal;Further, both the header and footer has left, right and center section options. You will get the string of the text and format applied to each of the left, right and center sections.
You need to then parse the string and get the format and other information from the string. Refer to the following code snippet:
let leftFooterInfo = getHeaderFooterContents(headerFooterInfo.header.left); console.log(leftFooterInfo); let rightFooterInfo = getHeaderFooterContents(headerFooterInfo.header.left); console.log(rightFooterInfo);Here getHeaderFooterContents is a function that parses the string to get the text and format details. The function “getHeaderFooterContents” is defined in the below sample.
I could also see that applying the “Double” underline in Custom Header/Footer was not working with the latest version of SpreadJS. I have reported it to the concerned team for further investigation. The internal tracking id for the same is: SJS-18652. I will let you know when there is an update from the dev team on this issue.
References:
pageHeaderFooter method: https://www.grapecity.com/spreadjs/api/v15/classes/GC.Spread.Sheets.Print.PrintInfo#pageheaderfooter
IPageSectionOptions Interface: https://www.grapecity.com/spreadjs/api/v15/interfaces/GC.Spread.Sheets.Print.IPageSectionOptions
IPageHeaderFooterOptions Interface: https://www.grapecity.com/spreadjs/api/v15/interfaces/GC.Spread.Sheets.Print.IPageHeaderFooterOptions#header
Please let us know if you still face any issues.
Regards,
Ankit

-
Posted 8 June 2023, 9:40 am EST
Perfect thanks
-
Posted 4 July 2023, 12:34 am EST
Hi Gagandeep,
The devs have informed us that the issue with internal tracking id SJS-18652 will be fixed in the SpreadJS V16.1.4 which will be released shortly. I will let you know when the version is released.
Regards,
Ankit
-
Posted 5 July 2023, 3:08 pm EST
Hi Gagandeep,
The SpreadJS V16.1.4 has been released and the mentioned issue has been fixed. Kindly upgrade to the latest version of SpreadJS.
You may download the latest version using the following link:
http://cdn.grapecity.com/spreadjs/16.1.4/Files/SpreadJS.Release.16.1.4.zipPlease let us know if you face any problems.
Regards,
Ankit

