I save it as csv which opens nicely in excel
I use this example
http://jsfiddle.net/sturtevant/vunf9/
On Thursday, February 11, 2016 at 1:15:01 PM UTC-5, ajay jaiswal wrote:
>
> I am firing query to database and getting in json format .
> I want to send it to client (browser) using express js.
> but i am not getting the data in browser.
>
> app.post("/downloadImportedTable", function (req, res) {
> var connection = new sql.Connection(dbConfig, function (err) {
>
> var dbObject = req.body.tableName;
> if (err) {
> res.status(500).send(String(err));
> } else {
> // Query
> var sqlrequest = new sql.Request(connection);
> sqlrequest.query('select * from ' + dbObject, function (err,
> recordset) {
>
> if (err) {
> res.status(500).send(String(err));
> connection.close();
> } else {
> //console.log(recordset);-----> it successfully fetch
> the data
>
> * res.set({ 'Content - Type': 'application/ms-excel;
> charset = UTF - 8' });*
> * res.status(200).send(recordset);*
>
> connection.close();
>
>
> };
> });
> }
> });
> };
>
>
> The recored set contains millions of record so if i convert it using npm
> json2xls it makes busy the browser and server to converting json into xlsx
> .so this approach i don't want to use.
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/6a8e0684-0916-490b-83b9-7918558de69c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.