Gateway vs. Client Jython script

When I run the below code in the client as opposed to the designer I get different results:

[code]startDate = 2013-04-18 15:43:38
endDate = 2013-04-18 21:57:23
extractInterval = 1
fileConct = “d:\data\extract\”
esServer = server1

scanClassQ = “”"
SELECT, sqlth_scinfo.scname AS Scan_Class, As tagID, sqlth_te.tagpath AS ioTags
FROM sqlth_scinfo
LEFT JOIN sqlth_te ON = sqlth_te.scid
WHERE sqlth_te.tagpath is not null
AND sqlth_scinfo.scname like ‘%s%%’
“”" %(esServer)
#obtain energy Server Scan class
scTags = system.db.runQuery(scanClassQ)
#build dictionary list
scanTagDict[esServer] = [row[‘ioTags’] for row in scTags]
tags = [ row for row in scanTagDict[esServer]]
print tags
tagData = system.tag.queryTagHistory(tags, startDate, endDate, None, “MinMax”, “Wide”, tags, None, extractInterval, None, None)
exportHist = system.dataset.toCSV(tagData, 1, 0)
system.file.writeFile(fileConct, exportHist , 1)[/code]

Running the code on the client actually returns a dtaset with times, values, and my actually header of all my tags. When running this script as a Timer task on the gateway It only returns the first tag in the sequence and dates with no data points. I’ve attached two sample csv files of the export. Please advise if I’m misinterpreting how the gateway handles lists as opposed to the client.
gateway_2013_04_18.csv (50.3 KB)
client_2013_04_18.csv (1.17 MB)

I can’t tell if you forgot to quote your parameter initializations or if we’re missing what the definition of ‘server1’ is. Either way, things should work the same from both the client and the gateway. It will be hard for us to troubleshoot this as is. Perhaps you could put some print statements in your script to help determine what precisely is different in the client vs the gateway?