You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.
// sends Excel file to web client requesting the / route
// server will respond with 500 error if excel workbook cannot be generated
var express = require('express');
var app = express();
app.get('/', function(req, res) {
wb.write('ExcelFile.xlsx', res);
});
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
Hi folks I'm using Azure container and It's not allow to use the express.js library, it's using some other vanilla methods and response can be returned only trough
context.res={
body: 'test'
}
So I'm not able to use this method wb.write('ExcelFile.xlsx', res);, because I don't have a RES. Tried context.res but it's also not working
Is there a way how can I get the binary data and put it to some variable and then put it into context.res={body:'test'} manually?
For example this code works and returns 'test' to me, but I'm not able to return binary data.
module.exports = async function (context, req) {
// Require library
var xl = require('excel4node');
var wb = new xl.Workbook();
var ws = wb.addWorksheet('S');
ws.cell(1, 1).string('A');
wb.write(`FileName.xlsx`, context.res);
context.res={
body: 'test'
}
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi folks I'm using Azure container and It's not allow to use the express.js library, it's using some other vanilla methods and response can be returned only trough
So I'm not able to use this method wb.write('ExcelFile.xlsx', res);, because I don't have a RES. Tried context.res but it's also not working
Is there a way how can I get the binary data and put it to some variable and then put it into context.res={body:'test'} manually?
For example this code works and returns 'test' to me, but I'm not able to return binary data.
The text was updated successfully, but these errors were encountered: