Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var xl = require('excel4node')
- const db = require('../config/db.config.js')
- const Report = db.report
- var wb = new xl.Workbook()
- var ws = wb.addWorksheet('MaterialFlowSheet');
- var style = wb.createStyle({
- font: {
- color: '#FF0800',
- size: 12
- }
- });
- module.exports.getexceldata = async function(req, res) {
- try {
- Report.findAll({
- where: {
- report_date: req.params.report_date
- }
- })
- ws.cell(1,1).string({vAbsorbing: req.body.vAbsorbing}).style(style)
- wb.write('Excel.xlsx');
- res.download('Excel.xlsx');
- } catch(e) {
- errorHandler(res, e)
- }
- }
- const db = require('../config/db.config.js')
- const Report = db.report
Add Comment
Please, Sign In to add comment