How can I make all fields equal to the text size? #3014

Open
opened 2023-10-18 15:25:36 +00:00 by Alexander-Sochi · 2 comments

const a = document.querySelector(".loaddata-command-btn-data-setup")
//const url = JSON.parse(CachedData);
//const raw_data = await(await fetch(url)).json();

function DownloadRawCacheDataToExcel() {

let e = Object.values(CachedData.fields);
let y = CachedData.data.map(d => {
    
    return {
        id: d.id,
        date: new Date(d.date).toISOString(),
        value: d.value,
        analitica2: d.analitica2,
        analitica3: d.analitica3,
        analitica4: d.analitica4
    }
  
})

const worksheet = XLSX.utils.json_to_sheet(y);
const workbook = XLSX.utils.book_new();

XLSX.utils.sheet_add_aoa(worksheet, [e], { origin: "A1" });



XLSX.utils.book_append_sheet(workbook, worksheet, "Dates");
XLSX.writeFile(workbook, "Presidents.xlsx", { compression: true });

}

const a = document.querySelector(".loaddata-command-btn-data-setup") //const url = JSON.parse(CachedData); //const raw_data = await(await fetch(url)).json(); function DownloadRawCacheDataToExcel() { let e = Object.values(CachedData.fields); let y = CachedData.data.map(d => { return { id: d.id, date: new Date(d.date).toISOString(), value: d.value, analitica2: d.analitica2, analitica3: d.analitica3, analitica4: d.analitica4 } }) const worksheet = XLSX.utils.json_to_sheet(y); const workbook = XLSX.utils.book_new(); XLSX.utils.sheet_add_aoa(worksheet, [e], { origin: "A1" }); XLSX.utils.book_append_sheet(workbook, worksheet, "Dates"); XLSX.writeFile(workbook, "Presidents.xlsx", { compression: true }); }
Owner

In the export demo https://docs.sheetjs.com/docs/getting-started/examples/export#clean-up-workbook , look at the code sample and explanation in "Changing Column Widths" (you will have to click to expand that section)

In the export demo https://docs.sheetjs.com/docs/getting-started/examples/export#clean-up-workbook , look at the code sample and explanation in "Changing Column Widths" (you will have to click to expand that section)

this piece of code does not work, please help me, I can only access the first column of type A, but I need to access all a, b...

this piece of code does not work, please help me, I can only access the first column of type A, but I need to access all a, b...
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3014
No description provided.