Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

Exporting XLSX files with WebMathematica

Posted 11 years ago
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:
          nb = MakeNotebook[];
          pdf = UseFrontEnd[ ExportString[ nb, "PDF"]];
          MSPURLStore[ pdf, "application/pdf", "notebook.pdf"]

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
2 Replies
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
Sean, you are right! The code... works just fine.
           list = RandomReal[100,{100,2}];
           xlsx = UseFrontEnd[ ExportString[ list, "xlsx"]];
          MSPURLStore[ xlsx, "application/xlsx", "test_file.xlsx"]
POSTED BY: Rodrigo Murta
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract