-3

I have a script that does not accept html or libraries. I can export to csv with this code https://code-maven.com/create-and-download-csv-with-javascript and it works , but the problem is i need xlsx format to do cells with format. Any idea?

Thanks!

  • This has been answered [here](https://stackoverflow.com/a/44428006/5712576) (with a working jsfiddle example) – Kays Kadhi Jan 29 '19 at 11:40
  • 1
    A `*.xlsx` file is a `ZIP` archive containing `XML` files and other files (images for example) in a special directory structure. Do creating a `*.xlsx` using `Excel`, then rename it `*.zip` and unzip it. Then you will see. So what you need for simplest `*.xlsx` is possibility for creating `XML` files and zipping them into a `ZIP` archive using `JavaScript`. This only using pure `JavaScript` without additional libraries? I would want see this ;-). – Axel Richter Jan 29 '19 at 12:02

1 Answers1

0

Thanks, but i cant use html code.

<input type="button" id="test" onClick="fnExcelReport();" value="download" />    
<div id='MessageHolder'></div>
<a href="#" id="testAnchor"></a>

I replaced the button with a function and confirm.

function alert() {
    var option = confirm("¿DOWNLOAD XSL?");
    if (option == true) {
        fnExcelReport();
    }
}
alert();

but i dont know how replace this part with javascript

<div id='MessageHolder'></div>
<a href="#" id="testAnchor"></a>
Hasta Dhana
  • 4,699
  • 7
  • 17
  • 26
  • This is not an answer but a new question. Please do not post new questions in an answer block. Do using a new question for this. But additional the question is totally unclear. If you post it new, then please do describing more clear what you are trying to achieve and what exactly is the problem with your current used code. – Axel Richter Feb 01 '19 at 04:52