24.11.2020, 09:51
(24.11.2020, 09:16)admin Wrote: Try this:
Code:<?
require('apps')
-- set headers for csv file download
setdlheader('text/csv; charset=utf-8', 'Consumption', 'csv')
-- generate csv here
value=grp.tag("consumption")
a={}
for index, id in ipairs(value) do
name=id["name"]
meter=id["data"]
consumption=name .."," .. meter
a[index]=consumi
end
print(a)
Thank you very much Admin, but unfortunately when I launch the script on the visu I receive response from http://192.168.1.10/user/csv.lp that it is not possible reach the web site. The script is correct and I cannot identify the problem.
Thanks.
BR