Exporting an Excel from Presto

vanolind
User offline. Last seen 40 weeks 6 days ago. Offline
Joined: 07/17/2009
Points: 30

Hey All,

I have a rather specific bit of functionality for the Presto Server that I require for a certain task.  Can Presto itself create excel documents that can be downloaded and then opened on the user's computer, or is the only way to generate an excel spreadsheet is to use the Excel Plugin and connect to the server that way. 

I'm asking this because I couldn't find information if Presto can actually generate excel documents from the use of a datasource WITHOUT Microsoft Excel being used in the process.  And I need this because of certain security requirements on the system that opening a connection to the presto server itself using a plugin in excel would not be possible, but it would be possible to get a downloadable file from our software which was in a excel format.

If any one has information on the contrary or could point me in the right direction, that would be quite helpful.  Thank you for your time.

0
Your rating: None
vanolind
User offline. Last seen 40 weeks 6 days ago. Offline
Joined: 07/17/2009
Points: 30

Woops!  Had the forum entry on read only.  Didn't want that!

smitchell
smitchell's picture
User offline. Last seen 2 weeks 5 days ago. Offline
Joined: 08/29/2008
Points: 34

If you don't want to use the Excel Add-on from Presto, there a couple of issues to your problem with potential work arounds:

1. Presto doesn't have any built-in capability to write files. You can use different extension techniques, however, to overcome this:

   a. You can use <script> in EMML in a mashup and use Java I/O classes to write a file.
   b. You can use <xslt> in EMML and the <xsl:result-document> statement from XSLT 2.0 to write one or several files. This is fairly straight-forward, even if you're not very familiar with XSLT as the stylesheet would likely just be handling the file writing step.
   c. You could add a target in an Ant build.xml file to invoke a mashup in Presto and have Ant write the file. This would be useful if you need to do this in a batch process or part of a development build cycle.

2. The actual format of the file is an issue:

   a. Not being really familiar with native XLS formats, my ignorant suspicion is that writing native spreadsheets would be a lot of work.
   b. You can, however, easily write XML from a mashup in any form you want. Excel will open XML -- but since 2007 Excel has a native XML format (try saving as XML to see this or get the specs from Microsoft). So you could fairly easily create this Excel XML format. The last time I looked at this, the XML was full of an appauling number of namespaces which may make this somewhat more challenging -- blame Microsoft for that please :-)
   c. You also can output CSV from a mashup.  Simply create the data in some XML format that has simple rows and columns and use the built-in global macro FormatAsCSV, in Presto to transform that to CSV. Users can also open CSV in Excel.

It wasn't clear from your post whether you also wanted Presto to handle the "download to the user's computer" step or not?

Sara, technical writer/jackbe

 

vanolind
User offline. Last seen 40 weeks 6 days ago. Offline
Joined: 07/17/2009
Points: 30

Well the front end of the App is an Adobe Flex based application, so the goal would be to ge the Excel File to the Flex Application, which would then be able to serve it to the user who wanted to download it.  Jackbe presto itself wouldn't need an interface to download files from, since we are hitting it remotely.

smitchell
smitchell's picture
User offline. Last seen 2 weeks 5 days ago. Offline
Joined: 08/29/2008
Points: 34

I think I understand, but let me restate it just to be clear. You want Presto to generate Excel files and save them somewhere that the Flex-based application can access it. Right?

If this is correct, then it seems like the solutions from my previous reply may work. Certainly, Presto can write XML files using these techniques. Not sure whether your Flex-based application can use the XML files as a source or if the file format has to be native Microsoft Excel format. 

Sara, technical writer/jackbe