title: Spotfire-IronPython: Create an empty datatable and add rows
body: <p>My goal is to write out a custom csv file out based on visualization information.</p>
  
  <p>After reading each page, I fetch the filtered rows. After doing some calculations, I would like to write columns or rows out into csv file. Could you please provide example snippet on how to achieve this? 
  Here is my try so far:</p>
  
  <pre><code>for pg in Document.Pages
      table = pg.ActiveDataTableReference
      filteredRows = pg.ActiveFilteringSelectionReference.GetSelection(table).AsIndexSet()
  
      # here to do some calculations, calculatedColumns/rows
      # Here to write calculatedColumns/rows into a new data table
      writer = Document.Data.CreateDataWriter(DataWriterTypeIdentifiers.ExcelXlsDataWriter) # to look if there is CSV TypeIdentifier
  
      stream = File.OpenWrite("E:\\Spotfire_Export\\Page_"+str(count) +"_"+ pg.Title +".csv")
  
      # Use writer class to write calculated columns to new table
      stream.Close()
      stream.Dispose()
  </code></pre>