Creating a Spreadsheet and population it with data

Hi,

I want to create a spreadsheet like below and populate it with data from my InflusDB.

Any pointers as how to create the spreadsheet with node-red or any other idea on how to do this reporting, it's for a monthly report I need to mail off.

What kind of spreadsheet? Excel or Google? Both are available as custom nodes.

https://flows.nodered.org/

Thanks that were my first call, the nodes for both lack formatting. You can only populate a cell, no font, border or alignments available.

Both have API's though which is why I asked for more details. If, for example, you were running Node-RED on a Windows OS, you might have Office installed and could make use of either Office Macro's or PowerShell.

You could also use a template spreadsheet with formatting and macro's built in.

My Node-Red is deployed on a Linux VM and don't have office.

How to do this then?

I need something like below, if I get the basics on how to do 4-5 cells I should manage the rest.

I have a flow using excle sheet node

[
    {
        "id": "2eb90985413cd7a8",
        "type": "excelsheets",
        "z": "74afde7d.c4af",
        "name": "",
        "file": "",
        "x": 570,
        "y": 400,
        "wires": [
            []
        ]
    },
    {
        "id": "e73092e12d692861",
        "type": "function",
        "z": "74afde7d.c4af",
        "name": "automated",
        "func": "msg.payload = [\n    {\n        header: {\n            col1: \"automated\",\n            col2: \"\",\n            col3: \"\",\n            col4: \"\",\n            col5: \"\",\n            col6: \"\",\n            col7: \"\",\n            col8: \"\",\n            col9: \"\",\n            col10: \"\",\n            col11: \"\",\n            col12: \"\",\n            col13: \"\",\n            col14: \"\",\n            col15: \"\",\n            col16: \"\",\n            col17: \"\",\n            col18: \"\",\n            col19: \"\",\n            col20: \"\",\n            col21: \"\",\n            col22: \"\",\n            col23: \"\",\n            col24: \"\",\n            col25: \"\",\n            col26: \"\",\n            col27: \"\",\n            col28: \"\",\n            col29: \"\",\n            col30: \"\",\n            col31: \"\",\n            col32: \"\",\n            col33: \"\",\n            col34: \"\",\n            col35: \"\",\n            col36: \"\",\n            col37: \"\",\n            col38: \"\",\n            col39: \"\"   \n\n        },\n        items: [\n            {\n                col1: \"Form B: Temperature record\",\n                col2: \"\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"Year\",\n                col8: msg.year,\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\",\n                col40: \"\"\n\n            },\n            {\n                col1: \"Cold Water Temperature\",\n                col2: \"\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            },\n            {\n                col1: \"Type\",\n                col2: \"No\",\n                col3: \"Location\",\n                col4: \"Jan\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"Feb\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"Mar\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"Apr\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"May\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"Jun\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"Jul\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"Aug\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"Sep\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"Oct\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"Nov\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"Dec\",\n                col38: \"\",\n                col39: \"\"\n            }, {\n                col1: \"\",\n                col2: \"\",\n                col3: \"\",\n                col4: \"Min\",\n                col5: \"Avg\",\n                col6: \"Max\",\n                col7: \"Min\",\n                col8: \"Avg\",\n                col9: \"Max\",\n                col10: \"Min\",\n                col11: \"Avg\",\n                col12: \"Max\",\n                col13: \"Min\",\n                col14: \"Avg\",\n                col15: \"Max\",\n                col16: \"Min\",\n                col17: \"Avg\",\n                col18: \"Max\",\n                col19: \"Min\",\n                col20: \"Avg\",\n                col21: \"Max\",\n                col22: \"Min\",\n                col23: \"Avg\",\n                col24: \"Max\",\n                col25: \"Min\",\n                col26: \"Avg\",\n                col27: \"Max\",\n                col28: \"Min\",\n                col29: \"Avg\",\n                col30: \"Max\",\n                col31: \"Min\",\n                col32: \"Avg\",\n                col33: \"Max\",\n                col34: \"Min\",\n                col35: \"Avg\",\n                col36: \"Max\",\n                col37: \"Min\",\n                col38: \"Avg\",\n                col39: \"Max\"\n            }, {\n                col1: \"Outlets\",\n                col2: \"1\",\n                col3: \"Here\",\n                col4: msg.janMin,\n                col5: msg.janAvg,\n                col6: msg.janMax,\n                col7: msg.febMin,\n                col8: msg.febAvg,\n                col9: msg.febMax,\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            },{\n                col1: \"\",\n                col2: \"2\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"3\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"4\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"5\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"Representative outlets on a rotational basis\",\n                col2: \"6\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"7\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"8\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"9\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"10\",\n                col3: \"\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"Visit Details\",\n                col2: \"\",\n                col3: \"Date\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            }, {\n                col1: \"\",\n                col2: \"\",\n                col3: \"Initials\",\n                col4: \"\",\n                col5: \"\",\n                col6: \"\",\n                col7: \"\",\n                col8: \"\",\n                col9: \"\",\n                col10: \"\",\n                col11: \"\",\n                col12: \"\",\n                col13: \"\",\n                col14: \"\",\n                col15: \"\",\n                col16: \"\",\n                col17: \"\",\n                col18: \"\",\n                col19: \"\",\n                col20: \"\",\n                col21: \"\",\n                col22: \"\",\n                col23: \"\",\n                col24: \"\",\n                col25: \"\",\n                col26: \"\",\n                col27: \"\",\n                col28: \"\",\n                col29: \"\",\n                col30: \"\",\n                col31: \"\",\n                col32: \"\",\n                col33: \"\",\n                col34: \"\",\n                col35: \"\",\n                col36: \"\",\n                col37: \"\",\n                col38: \"\",\n                col39: \"\"\n\n            },\n            \n            \n        ],\n        sheetName: \"automated\"\n    },\n\n]\nmsg.filepath = msg.home + 'Downloads/automated.xlsx';\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 310,
        "y": 400,
        "wires": [
            [
                "2eb90985413cd7a8",
                "f830a7bdd61db068"
            ]
        ]
    },
    {
        "id": "576e95b7f14092c0",
        "type": "inject",
        "z": "74afde7d.c4af",
        "name": "",
        "props": [
            {
                "p": "home",
                "v": "HOME",
                "vt": "env"
            },
            {
                "p": "payload"
            },
            {
                "p": "janMin",
                "v": "12",
                "vt": "num"
            },
            {
                "p": "janAvg",
                "v": "14",
                "vt": "num"
            },
            {
                "p": "janMax",
                "v": "36",
                "vt": "num"
            },
            {
                "p": "febMin",
                "v": "12",
                "vt": "num"
            },
            {
                "p": "febAvg",
                "v": "21",
                "vt": "num"
            },
            {
                "p": "febMax",
                "v": "12",
                "vt": "num"
            },
            {
                "p": "year",
                "v": "2024",
                "vt": "num"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Where",
        "payloadType": "str",
        "x": 110,
        "y": 400,
        "wires": [
            [
                "e73092e12d692861",
                "f830a7bdd61db068"
            ]
        ]
    },
    {
        "id": "f830a7bdd61db068",
        "type": "debug",
        "z": "74afde7d.c4af",
        "name": "debug 2",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 300,
        "y": 460,
        "wires": []
    }
]

I don't know how well you know Excel. I know it very well and my first approach (not necessarily best for you but one to look at anyway) would be to separate the data from the interface. You can do that with modern versions of Excel by putting the data into a CSV file and using PowerQuery in Excel to read in the data (and reshape it if needed). Excel itself can then do any formatting. Turning that into a PDF can be done by using .NET/PowerShell to drive Office's Save As PDF. The data refresh can be done the same way so that everything is automated.

However, there is also a completely different way to think of doing this that may not need Excel at all. If all you are looking for is a layout, this could all be done using HTML. I quickly created this by setting up in Excel, saving as HTML and doing some tidying on the resulting output. Not perfect but not bad for a couple of minutes spend while on another business call :grin:

<table border=0 cellpadding=0 cellspacing=0 width=586 style='border-collapse:collapse;table-layout:fixed;width:440pt'>
  <col  width=64 span=3 style='width:48pt'>
  <col  width=74 style='width:56pt'>
  <col  width=64 span=5 style='width:48pt'>
  <tr  height=19 style='height:14.4pt'>
    <td rowspan=2 height=38  width=64 style='height:28.8pt;width:48pt'>Type</td>
    <td rowspan=2  width=64 style='width:48pt'>No</td>
    <td rowspan=2  width=64 style='width:48pt'>Location</td>
    <td colspan=3  width=202 style='border-left:none;width:152pt'>Jan</td>
    <td colspan=3  width=192 style='border-left:none;width:144pt'>Feb</td>
  </tr>
  <tr  height=19 style='height:14.4pt'>
    <td height=19  style='height:14.4pt;border-top:none;border-left:
  none'>Min</td>
    <td  style='border-top:none;border-left:none'>Avg</td>
    <td  style='border-top:none;border-left:none'>Max</td>
    <td  style='border-top:none;border-left:none'>Min</td>
    <td  style='border-top:none;border-left:none'>Avg</td>
    <td  style='border-top:none;border-left:none'>Max</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td rowspan=3 height=57  style='height:43.2pt;border-top:none'>Outlets</td>
    <td  align=right style='border-top:none;border-left:none'>1</td>
    <td  style='border-top:none;border-left:none'>Here</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td height=19  align=right style='height:14.4pt;border-top:none;
  border-left:none'>2</td>
    <td  style='border-top:none;border-left:none'>x1</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td height=19  align=right style='height:14.4pt;border-top:none;
  border-left:none'>3</td>
    <td  style='border-top:none;border-left:none'>x2</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td rowspan=3 height=57  style='height:43.2pt;border-top:none'>Type
      2</td>
    <td  align=right style='border-top:none;border-left:none'>4</td>
    <td  style='border-top:none;border-left:none'>x3</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td height=19  align=right style='height:14.4pt;border-top:none;
  border-left:none'>5</td>
    <td  style='border-top:none;border-left:none'>x4</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td height=19  align=right style='height:14.4pt;border-top:none;
  border-left:none'>6</td>
    <td  style='border-top:none;border-left:none'>x5</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>14</td>
    <td  align=right style='border-top:none;border-left:none'>36</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
    <td  align=right style='border-top:none;border-left:none'>21</td>
    <td  align=right style='border-top:none;border-left:none'>12</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td colspan=2 rowspan=2 height=38  style='height:28.8pt'>Visit
      Details</td>
    <td  style='border-top:none;border-left:none'>Date</td>
    <td  align=right style='border-top:none;border-left:none'>2023-01-06</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
  </tr>
  <tr height=19 style='height:14.4pt'>
    <td height=19  style='height:14.4pt;border-top:none;border-left:
  none'>Initials</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
    <td  style='border-top:none;border-left:none'>&nbsp;</td>
  </tr>
  <tr height=0 style='display:none'>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=74 style='width:56pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
    <td width=64 style='width:48pt'></td>
  </tr>
</table>

Thank you, that will be the easiest way to create it.

I wanted to have a PDF at the end of the day, create HMTL -> Save it -> read it -> convert to PDF -> Save it and then send it as a attachment to a mail.

image

[
    {
        "id": "badc71f9907a62ef",
        "type": "file",
        "z": "74afde7d.c4af",
        "name": "",
        "filename": "Downloads\\a.html",
        "filenameType": "str",
        "appendNewline": false,
        "createDir": false,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 790,
        "y": 1160,
        "wires": [
            [
                "9d2b8a63573aaf2d"
            ]
        ]
    },
    {
        "id": "fd4a9b0bb13899f7",
        "type": "function",
        "z": "74afde7d.c4af",
        "name": "create html",
        "func": "\nlet html = `<table border=0 cellpadding=0 cellspacing=0 width=586 style='border-collapse:collapse;table-layout:fixed;width:440pt'>\n  <col  width=64 span=3 style='width:48pt'>\n  <col  width=74 style='width:56pt'>\n  <col  width=64 span=5 style='width:48pt'>\n  <tr  height=19 style='height:14.4pt'>\n    <td rowspan=2 height=38  width=64 style='height:28.8pt;width:48pt'>Type</td>\n    <td rowspan=2  width=64 style='width:48pt'>No</td>\n    <td rowspan=2  width=64 style='width:48pt'>Location</td>\n    <td colspan=3  width=202 style='border-left:2px solid black;width:152pt'>Jan</td>\n    <td colspan=3  width=192 style='border-left:2px solid black;width:144pt'>Feb</td>\n<td colspan=3  width=192 style='border-left:2px solid black;width:144pt'>Mar</td>\n  </tr>\n  <tr  height=19 style='height:14.4pt'>\n    <td height=19  style='height:14.4pt;border-top:2px solid black;border-left:\n  2px solid black'>Min</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Avg</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Max</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Min</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Avg</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Max</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Min</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Avg</td>\n    <td  align=left style='border-top:2px solid black;border-left:2px solid black'>Max</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td rowspan=3 height=57  style='height:43.2pt;border-top:2px solid black'>Outlets</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>1</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>Here</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td height=19  align=center style='height:14.4pt;border-top:2px solid black;\n  border-left:2px solid black'>2</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>x1</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td height=19  align=center style='height:14.4pt;border-top:2px solid black;\n  border-left:2px solid black'>3</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>x2</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td rowspan=3 height=57  style='height:43.2pt;border-top:2px solid black'>Type\n      2</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>4</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>x3</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td height=19  align=center style='height:14.4pt;border-top:2px solid black;\n  border-left:2px solid black'>5</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>x4</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td height=19  align=center style='height:14.4pt;border-top:2px solid black;\n  border-left:2px solid black'>6</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>x5</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>14</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>36</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>21</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>12</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td colspan=2 rowspan=2 height=38  style='height:28.8pt'>Visit\n      Details</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>Date</td>\n    <td  align=center style='border-top:2px solid black;border-left:2px solid black'>2023-01-06</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n  </tr>\n  <tr height=19 style='height:14.4pt'>\n    <td height=19  style='height:14.4pt;border-top:2px solid black;border-left:\n  2px solid black'>Initials</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n    <td  style='border-top:2px solid black;border-left:2px solid black'>&nbsp;</td>\n  </tr>\n  <tr height=0 style='display:2px solid black'>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=74 style='width:56pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n    <td width=64 style='width:48pt'></td>\n  </tr>\n</table>`\n\n\n\n\nhtml = html + `</tbody>\n    </table>\n</body>\n</html>`\n\nmsg.payload = html\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 1160,
        "wires": [
            [
                "badc71f9907a62ef"
            ]
        ]
    },
    {
        "id": "8533daa06b8aa324",
        "type": "inject",
        "z": "74afde7d.c4af",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 360,
        "y": 1160,
        "wires": [
            [
                "fd4a9b0bb13899f7"
            ]
        ]
    },
    {
        "id": "7d6b8bfe02c214e5",
        "type": "html-to-pdf",
        "z": "74afde7d.c4af",
        "name": "",
        "format": "A4",
        "zoom": 100,
        "orientation": "Landscape",
        "width": "",
        "height": "",
        "marginTop": 1,
        "marginLeft": 1,
        "marginBottom": 1,
        "marginRight": 1,
        "marginTopUnits": "cm",
        "marginLeftUnits": "cm",
        "marginBottomUnits": "cm",
        "marginRightUnits": "cm",
        "omitBackground": false,
        "printGraphics": true,
        "x": 590,
        "y": 1220,
        "wires": [
            [
                "c15da04027fc6ba0"
            ]
        ]
    },
    {
        "id": "9d2b8a63573aaf2d",
        "type": "file in",
        "z": "74afde7d.c4af",
        "name": "",
        "filename": "Downloads\\a.html",
        "filenameType": "str",
        "format": "utf8",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "allProps": false,
        "x": 390,
        "y": 1220,
        "wires": [
            [
                "7d6b8bfe02c214e5"
            ]
        ]
    },
    {
        "id": "c15da04027fc6ba0",
        "type": "file",
        "z": "74afde7d.c4af",
        "name": "",
        "filename": "Downloads\\a.pdf",
        "filenameType": "str",
        "appendNewline": false,
        "createDir": false,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 790,
        "y": 1220,
        "wires": [
            []
        ]
    }
]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.