Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Changing the Excel report name

  • How can i change the name of the excel report file?

  • @srashid actually I shoud say, Can i get rid of the time stamp from the name of the file?

  • Hi srashid,

    The timestamp is in the filename so that running the same report multiple times does not result it overwriting the file. Are you wishing that each run of the file would overwrite the existing report, and that it be named with the report name?

  • @phildunlap In the file name, it shows me date_time_name of the template. i wanted to get rid of the time stamp. and keep only the date and template name.

  • Ah okay, so it's a daily report I would guess. You would have to do this in a script and have an SQL point that updates table only in the context

    var basePath = "/path/to/Mango";
    var reportsDirectory = new + "/web/modules/excelReports/web/report-data");
    var reports = reportsDirectory.listFiles();
    for(var k = 0; k < reports.length; k+=1) {
        var filenameInfo = /(.*?__20\d\d)[^.]+(\.xlsx?)/.exec(reports[k].getName());
        if(filenameInfo !== null) {
            var newFilename = filenameInfo[1] + filenameInfo[2];
            sqlPoint.set("(" + newFilename +","+ reports[k].getName()+")");
            var newFile = new + "/web/modules/excelReports/web/report-data/" + newFilename);
            java.nio.file.Files.move(reports[k].toPath(), newFile.toPath());

    Here's the JSON for my scripting data source and my SQL data source.

             "name":"Rename Reports",
             "cronPattern":"0 5 0\/1 * * ?",
             "script":"var basePath = \"\/path\/to\/Mango\";\nvar reportsDirectory = new + \"\/web\/modules\/excelReports\/web\/report-data\");\nvar reports = reportsDirectory.listFiles();\nfor(var k = 0; k < reports.length; k+=1) {\n    var filenameInfo = \/(.*?__20\\d\\d)[^.]+(\\.xlsx?)\/.exec(reports[k].getName());\n    if(filenameInfo !== null) {\n        var newFilename = filenameInfo[1] + filenameInfo[2];\n        sqlPoint.set(\"(\" + newFilename +\",\"+ reports[k].getName()+\")\");\n        var newFile = new + \"\/web\/modules\/excelReports\/web\/report-data\/\" + newFilename);\n        java.nio.file.Files.move(reports[k].toPath(), newFile.toPath());\n    }\n}",
             "selectStatement":"select '' from systemSettings",
                "updateStatement":"update excelReports set filename='?' where filename='?'"

    I have it running at the fifth minute of each hour, assuming the report is probably generated on some hour. You could work the cron to happen after the report is run.