We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We are trying to export an excel that comes from an array of objects, in example:
{ "success": true, "hojas": { "Imputaciones": { "columnas": [ [ "Id", "Email", "Nombre Completo", "Puesto", "Equipos", "Áreas de Práctica", "Socio Referencia", "Manager Referencia", "Fecha Grabación", "Fecha Imputacion", "Centro de Facturación", "Cliente", "Exp. Referencia Antigua", "Exp. Referencia Actual", "Expediente", "Asunto", "Descripcion", "Tiempo", "Horas", "Minutos", "Estado" ] ], "columnas_con_fechas": [ [ "Fecha Grabación", "Fecha Imputacion" ] ], "columnas_con_html": [ [ "Descripcion" ] ], "valores": [ [ 292195, "xxxxx@xxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, null, "2022-07-13T07:17:40.173", "2022-07-13", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, "<p>Reporte trimestral de los casos en FinRep. </p>\r\n\r\n<p>FPCE. Revisión de los módulos mandatory con sus responsables. Redacción de las respuestas y recopilación de evidencias. </p>", 7, 7, 0, "Pendiente de revisar" ], ], "total": 8, "title": "Imputaciones" } }, "sheet": "Imputaciones", "title": "imputaciones_todas", "filas_por_pagina": 1000, "pagina": 1 }
The thing is that in excel the colum "Descripcion" its not showing as html but showing the html tags, etc.
I tried to fill the "h" property of the cell but it does not change the output.
I've search a lot and didnt see any issue like this,
can you help me please?
The text was updated successfully, but these errors were encountered:
const XLSX = require('xlsx'); const htmlToText = require('html-to-text'); // This library helps to convert HTML to plain text // Sample data const data = { "success": true, "hojas": { "Imputaciones": { "columnas": [ ["Id", "Email", "Nombre Completo", "Puesto", "Equipos", "Áreas de Práctica", "Socio Referencia", "Manager Referencia", "Fecha Grabación", "Fecha Imputacion", "Centro de Facturación", "Cliente", "Exp. Referencia Antigua", "Exp. Referencia Actual", "Expediente", "Asunto", "Descripcion", "Tiempo", "Horas", "Minutos", "Estado"] ], "columnas_con_fechas": [ ["Fecha Grabación", "Fecha Imputacion"] ], "columnas_con_html": [ ["Descripcion"] ], "valores": [ [292195, "xxxxx@xxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, null, "2022-07-13T07:17:40.173", "2022-07-13", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, "<p>Reporte trimestral de los casos en FinRep. </p>\r\n\r\n<p>FPCE. Revisión de los módulos mandatory con sus responsables. Redacción de las respuestas y recopilación de evidencias. </p>", 7, 7, 0, "Pendiente de revisar"] ], "total": 8, "title": "Imputaciones" } }, "sheet": "Imputaciones", "title": "imputaciones_todas", "filas_por_pagina": 1000, "pagina": 1 }; // Extract data for the worksheet const sheetData = [data.hojas.Imputaciones.columnas[0]]; data.hojas.Imputaciones.valores.forEach(row => { // Convert HTML content to plain text row[16] = htmlToText.convert(row[16]); sheetData.push(row); }); // Create a new workbook and a worksheet const wb = XLSX.utils.book_new(); const ws = XLSX.utils.aoa_to_sheet(sheetData); // Add the worksheet to the workbook XLSX.utils.book_append_sheet(wb, ws, data.sheet); // Write the workbook to a file XLSX.writeFile(wb, `${data.title}.xlsx`);
Sorry, something went wrong.
No branches or pull requests
We are trying to export an excel that comes from an array of objects, in example:
{ "success": true, "hojas": { "Imputaciones": { "columnas": [ [ "Id", "Email", "Nombre Completo", "Puesto", "Equipos", "Áreas de Práctica", "Socio Referencia", "Manager Referencia", "Fecha Grabación", "Fecha Imputacion", "Centro de Facturación", "Cliente", "Exp. Referencia Antigua", "Exp. Referencia Actual", "Expediente", "Asunto", "Descripcion", "Tiempo", "Horas", "Minutos", "Estado" ] ], "columnas_con_fechas": [ [ "Fecha Grabación", "Fecha Imputacion" ] ], "columnas_con_html": [ [ "Descripcion" ] ], "valores": [ [ 292195, "xxxxx@xxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, null, "2022-07-13T07:17:40.173", "2022-07-13", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", "xxxxxxx", null, "<p>Reporte trimestral de los casos en FinRep. </p>\r\n\r\n<p>FPCE. Revisión de los módulos mandatory con sus responsables. Redacción de las respuestas y recopilación de evidencias. </p>", 7, 7, 0, "Pendiente de revisar" ], ], "total": 8, "title": "Imputaciones" } }, "sheet": "Imputaciones", "title": "imputaciones_todas", "filas_por_pagina": 1000, "pagina": 1 }
The thing is that in excel the colum "Descripcion" its not showing as html but showing the html tags, etc.
I tried to fill the "h" property of the cell but it does not change the output.
I've search a lot and didnt see any issue like this,
can you help me please?
The text was updated successfully, but these errors were encountered: