I want to generate excel file with Header

Currently I generate excel file using MySQL database, but I want to add header on an excel sheet. Is it possible to add header?
I attached the sample picture of what I want

Can you explain how you do that please? A simple example flow would be useful.

[
    {
        "id": "85d23d3c7c2b9c49",
        "type": "excel",
        "z": "5b0c141e78dae949",
        "name": "",
        "file": "C:\\temp\\test.xlsx",
        "x": 830,
        "y": 200,
        "wires": [
            []
        ]
    },
    {
        "id": "511698bdc85a0825",
        "type": "mysql",
        "z": "5b0c141e78dae949",
        "mydb": "4290109d50355584",
        "name": "",
        "x": 650,
        "y": 200,
        "wires": [
            [
                "7ee0011e4002ec88",
                "eb0a02d5afe88ec6",
                "85d23d3c7c2b9c49"
            ]
        ]
    },
    {
        "id": "b723f34270f1847d",
        "type": "function",
        "z": "5b0c141e78dae949",
        "name": "select",
        "func": "var fromdate=msg.payload.From;\nvar todate = msg.payload.To;\nmsg.topic = \"SELECT * FROM `ems`.`m1` where DateTime between '\"+fromdate+\"' And '\"+todate+\"';\";\nreturn msg;\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 430,
        "y": 200,
        "wires": [
            [
                "511698bdc85a0825"
            ]
        ]
    },
    {
        "id": "a0f935a3a21d4a95",
        "type": "ui_form",
        "z": "5b0c141e78dae949",
        "name": "",
        "label": "",
        "group": "126d3db65e2e2039",
        "order": 1,
        "width": 7,
        "height": 1,
        "options": [
            {
                "label": "From",
                "value": "From",
                "type": "date",
                "required": true,
                "rows": null
            },
            {
                "label": "To",
                "value": "To",
                "type": "date",
                "required": true,
                "rows": null
            }
        ],
        "formValue": {
            "From": "",
            "To": ""
        },
        "payload": "",
        "submit": "Generate Report",
        "cancel": "cancel",
        "topic": "topic",
        "topicType": "msg",
        "splitLayout": true,
        "className": "",
        "x": 250,
        "y": 200,
        "wires": [
            [
                "b723f34270f1847d"
            ]
        ]
    },
    {
        "id": "4290109d50355584",
        "type": "MySQLdatabase",
        "name": "",
        "host": "127.0.0.1",
        "port": "3306",
        "db": "ems",
        "tz": "",
        "charset": "UTF8"
    },
    {
        "id": "126d3db65e2e2039",
        "type": "ui_group",
        "name": "Daily Report",
        "tab": "78f8e318a5983d02",
        "order": 2,
        "disp": true,
        "width": 7,
        "collapse": false,
        "className": ""
    },
    {
        "id": "78f8e318a5983d02",
        "type": "ui_tab",
        "name": "Report",
        "icon": "cloud_download",
        "order": 17,
        "disabled": false,
        "hidden": false
    }
]

but as see you in picture, I want to add header on excel

If you want anyone to actually try your flow you will need to link to the exact excel node type (there is more than one)

Also, when providing a demo flow, it is courteous to provide sample data (in an inject or change node) instead of a database node that will never work on the helpers node-red (since we dont have your data or access to it!)

2 Likes

Sorry for that I am using " node-red-contrib-excel" excel node

Basically Steve is saying if you want help provide data. Connect a debug node to the output of the mysql node and then copy the output and look at it and redact any confidential information.

Then put that data into an inject node and attach it to the node that process the output of the mysql node. Then test it to see it produces some result.

Finally export the flow from the inject node onward and provide that for someone to be able to run it.

2 Likes