   where = "WHERE t.matchid = p.matchid"
   limit = "LIMIT #{opts.limit}"
   
-  for report in reports
+
+  async.forEachSeries reports, (report, report_cb) ->
     
     for cond in report.conditions
       where += " AND #{cond}"


    fullQuery = [select, from, where, orderBy, limit].join " "
    
    query = new Query 
      body: fullQuery
    
    query.run (err, rows) ->
      
      formattedRows = applyColumnTemplates rows, activeColumns
      # ties logic, # records, second order calculations
      
      tableText = toLatexTable

assert        = require "assert"

fs            = require "fs"
moment        = require "moment"
_             = require "underscore"
async         = require "async"

Query         = require "../query"
toLatexTable  = require "../toLatexTable"
