Good Template for Excel

I have to show this to a customer on Friday.

I have my MYSQL database and SQL Tags Historian setup and logging. I need to be able to automatically every 10, 30 and 60 minutes to run a query on certian tags and export these to the same excel spreadsheet. Where in the excel spreadsheet I can then move the tags to the correct column and row.

Is there a good document on how to do this.

Sure, you can create a timer script that runs on the gateway (in one location) every 30 seconds like this:[code]from java.util import Date
from java.util import Calendar

endDate = Date()
cal = Calendar.getInstance()
cal.setTime(endDate)
cal.add(Calendar.HOUR, -24)
startDate = cal.getTime()
ds = system.tag.queryTagHistory(["[dbname]Path/To/Tag1", “[dbname]Path/To/Tag2”], startDate, endDate, 0, “MinMax”, “Wide”, [“Tag1”, “Tag2”])

spreadsheet = system.dataset.dataSetToExcel(1, [ds])
filePath = “C:\output\results.xls”
system.file.writeFile(filePath, spreadsheet)[/code][where “dbname” in the queryTagHistory() function is the name of the database connection holding your SQLTag history data]

Hope that helps you get started.