Group Abstract Group Abstract

Message Boards Message Boards

Exporting XLSX files with WebMathematica

GROUPS:
I know that WebMathmatica has examples do export to PDF (in link form and as direct download).
We can see it in content and contect store examples.
Here is the code for PDF:
<msp:evaluate>
          nb = MakeNotebook[];
          pdf = UseFrontEnd[ ExportString[ nb, "PDF"]];
          MSPURLStore[ pdf, "application/pdf", "notebook.pdf"]
</msp:evaluate>

I would like to know how can I do the same for Excel XLSX files;

For example, if I have this list:
list = RandomInteger[100, {20, 5}]
How can I export list as an Excel file using WebMathematica?

tks in advance
POSTED BY: Rodrigo Murta
Answer
8 months ago
Does ExportString not work for you with XLSX?
ExportString[{1, 2, 3, 4}, "XLSX"]

I don't have a configured and set up instance of webMathematica, but that would seem to be what you want to do by analogy.
POSTED BY: Sean Clarke
Answer
8 months ago
Sean, you are right! The code... works just fine.
<msp:evaluate>
           list = RandomReal[100,{100,2}];
           xlsx = UseFrontEnd[ ExportString[ list, "xlsx"]];
          MSPURLStore[ xlsx, "application/xlsx", "test_file.xlsx"]
</msp:evaluate>
tks
POSTED BY: Rodrigo Murta
Answer
8 months ago