Node.js support for Exporting excel and Database

1,276 views
Skip to first unread message

Syed Haani

unread,
Nov 27, 2013, 6:55:40 AM11/27/13
to nod...@googlegroups.com

I am new to node.js.

I am currently in a pre-development phase of an application.

The application will be for tracking status of task of employee. The admin will have the right to export excel which will have data of employes for a given date range

Currently I am thinking WCF Service and SQL Server for the backend.

Few days back, someone told me about node.js and it's capabilities. And yes I was impressed

I wanted to know if I write a service with node.js, how will the service be hosted, also if I can write code for exporting data in excel, and lastly which database providers/adapters does node.js support?

Apologies if there is typo or this question need to be asked in any other community of stackExchange.

Thanks in advance

Syed

klrumpf

unread,
Nov 27, 2013, 7:47:34 AM11/27/13
to nod...@googlegroups.com
Maybe look at unoconv  http://dag.wiee.rs/home-made/unoconv/

and do something in the line of

exec("unoconv -f csv myfile.xls", err,... 

Downside, needs the bulky libreoffice libs installed.

I wouldn't use the unoconv listener, seems a cpu killer.

There's also node-unoconv, never tried that.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Diogo Resende

unread,
Nov 27, 2013, 12:53:58 PM11/27/13
to nod...@googlegroups.com

Michael J. Ryan

unread,
Nov 27, 2013, 5:21:11 PM11/27/13
to nod...@googlegroups.com
If you do an exec like that for something heavy, might want to wrap it into a module that itself is wrapped in a generic pool (to prevent too many instances from running)

Michael J. Ryan

unread,
Nov 27, 2013, 5:26:54 PM11/27/13
to nod...@googlegroups.com
If you use MS-SQL server, would suggest the “tedious” module over the MS one... it’s more portable.  You may want to consider PostgreSQL or MySQL if either are an option (I prefer PostreSQL).  (based on what your are describing for your data, I would lean towards an SQL database vs a non-relational db...  Some use cases are better suited for NoSQL, yours doesn’t seem to be one of them)
 
You can mount endpoints pretty easily with nodejs, though there are some REST frameworks for getting you going faster.
 
For running the application as a service in windows, you’ll likely want to use NSSM (Non-Sucking Service Manager) to create your service entry in windows.  For Linux, depends on your distro & version.
 
As for “exporting” to excel if you only need one worksheet would just output to CSV which excel can open (then re-save) fine... if you need more, there are libraries, but they come with a little more overhead.
--

Richard Marr

unread,
Dec 3, 2013, 4:28:13 AM12/3/13
to nod...@googlegroups.com
Hi Syed,

You don't need anything special to export Excel files, you just need the same web server and templating modules that you use to serve HTML.

Set a Content-Disposition header in your response, and output an HTML3 document containing just a table, then Excel will be a happy bunny.

e.g.

Content-Disposition: attachment; filename="my-spreadsheet.xls"

<html>
  <body>
    <table>
      <tr>
        <td>A spreadsheet with one cell</td>
      </tr>
    </table>
  </body>
</html>

--
Richard Marr
Reply all
Reply to author
Forward
0 new messages