Obtaining Header or Footer information from an XLSX file using Angular

CLICK HERE FOR XLSX HEADER IMAGE

I am struggling to retrieve the header and footer data from an xlsx file. I have only managed to access the information inside the workbook so far.

I attempted to extract the header/footer using the following method, but it did not work as expected:

import * as XLSX from 'xlsx';

const firstSheetName = ws.SheetNames[0];
const worksheet = ws.Sheets[firstSheetName];

const headerCells = XLSX.utils.sheet_to_json(worksheet, { header: 1 })[0];

console.log("headerCells :",headerCells); 

Answer №1

If you're looking to access headers and footers in XLSX files, unfortunately there is no direct option like the headerFooter tag in the sheet.xml.

However, consider using a library such as ExcelJS:

worksheet.headerFooter.oddFooter

For more details, check out the documentation:

Headers and Footers

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Returning a Response in HapiJS Routes from Incoming Requests

Currently, I am facing an issue with the request module where I am able to successfully make a request and receive a response. However, I am struggling to figure out how to pass this response back to my route in order to return it to my client. Here is th ...

Why isn't my named function functioning properly in node.js?

Trying my hand at creating an HTTP server using node.js. This code snippet is successful: const http = require('http'); const server = http.createServer((req, res) => { console.log(req.url); res.end('Hello Node.js'); }); server.lis ...

What is the right way to configure an Axios Interceptor in a ReactJS app using TypeScript?

While I typically use JS with React, I decided to switch to Typescript. However, I've been encountering an error when trying to initialize a request interceptor instance: src/utils/services/axios.service.ts:16:8 TS2322: Type '{ 'Content-Type ...

Dealing with unassigned index in PHP and Ajax

What could be causing the variables in PHP to show as undefined? Code containing HTML <table> <tbody id="table"> <tr> <th colspan="2">SignUp</th> </tr> <tr> < ...

Use percentages for the width in CSS and pixels for the height, ensuring that both dimensions are equal

I'm attempting to create a square that adjusts its size according to the screen size. Currently, I have the width set to 25%. Is there a way to ensure that the height remains the same length in pixels as the width? Appreciate any assistance on this ...

Creating a data structure using jQuery/JavaScript when submitting a form - a guide

Currently, I am attempting to gather form input values and organize them into an array of objects that will then be sent to MongoDB. However, I am facing difficulty in figuring out how to include an array within the objects (refer to the comment in the cod ...

Touch gestures using Hammer.js including tapping and swiping downwards

Is there a way to use HammerJS in Angular Material to implement drag-down functionality that triggers an event? I want the dragdown event, as shown in the image below on the gray bar just above the Facebook button. How can I achieve this? https://i.sstat ...

guide to adjusting contrast and saturation levels with fabric.js

I am looking to adjust the contrast, saturation, and hue in my image editor using fabric.js. However, I have only been able to find the brightness option. Below is the code I have been using with fabric js: (function() { fabric.Object.prototype.transpar ...

The TSC directive requiring 372 seconds for execution

I recently discovered that my TypeScript Firebase repository, used for cloud functions and consisting of only 6 files in the src directory, was taking an unusually long time to compile when running the tsc command. To investigate further, I executed it wit ...

NgMap is encountering an issue with an unfamiliar provider: NgMapProvider <- NgMap, raising a concern

While utilizing ngMap, it encountered an error. I have carefully reviewed all components and settings. Interestingly, it works flawlessly in one part of my application but not in the other. These two instances are located in separate file locations. ...

Transform a checkbox input into two distinct buttons

I am trying to change the input checkbox that toggles between light and dark mode into two separate buttons. How can I achieve this functionality? Check out the demo here: https://jsfiddle.net/ot1ecnxz/1 Here is the HTML code: <input type="checkb ...

The Webmethod does not connect with Angular2, causing the entire page to display as raw HTML content

Here is a straightforward WebMethod: [WebMethod(EnableSession=true)] public static string Redirect() { object a= HttpContext.Current.Session; return "yeppieee"; } It is being called like this: this.http.get(`http://localhost/MyApp/Pages/TestPage ...

How to retrieve a JSON value without a key using jQuery

I am struggling to fetch JSON using jQuery. If anyone can help me figure out the mistake in my code that would be greatly appreciated. The data.json file contains { "value1", "value2", "value3", "value4" } Here is my jQuery code $.getJSON( "data.js ...

Angular 7 file download issues - Troubleshooting corrupted downloads

I am currently working on implementing a download feature in Angular 7, but I am encountering issues with corrupt files. The files (jpg, pdf, zip) are stored on a cloud server and retrieved using an Express Server with the following code: var url = ge ...

Get items from an array that have a property matching another array

Is there a more efficient way to create a new array with contact objects that have values matching those in selectedContact? selectedContact: number[] = [0,2] //value contacts: Contact[] = [{ firstName:"Dan"; lastName:"Chong"; email:"<a href="/c ...

Guide to showcasing images dynamically in Angular using .NET Core API and database

I am looking for a way to showcase an image that is stored in the database. Below is the code snippet showing how the image file gets uploaded to the database. public string UploadImage(IFormFile file) { if (file == null) thro ...

Writing and altering content within the <code> element in Chrome is unreliable

Utilizing a WYSIWYG Editor with contenteditable functionality allows users to input "code snippets" using a <code> element. Here is an example: <div contenteditable="true"> <p> This is a paragraph with an <code>inline s ...

Divide using two separators

const inputString = 'db.employee.find({"city":"Paris"},{"emp_id":1}' const result = inputString.split(/\.|\[); // splitting based on . or [ Is there a way to split a string based on two delimiters, such as . and [? For example, if we ...

Troubleshooting Angular Karma Testing: Uncaught ReferenceError - Stripe not recognized

When running tests with karma, I encountered the following error: ReferenceError: Stripe is not defined Component import { Component, OnInit } from "@angular/core"; import { FormBuilder } from "@angular/forms"; import { Router } from & ...

Is there a way for me to initiate another joyride adventure?

Encountering a challenge with my joyride tour - after completing one tour, I aim to commence a second. Despite attempting to trigger the second tour in the postRideCallback function, I find myself stuck in a loop with the first tour. Seeking guidance on re ...