# Replace tables from file
from System.Windows.Forms import OpenFileDialog
from Spotfire.Dxp.Data import *
import clr
from Spotfire.Dxp.Data import *
import clr
clr.AddReference("System.Windows.Forms")
#get filename from file chooser
d1 = OpenFileDialog()
d1.InitialDirectory='C:\myfiles\salesdata'
d1.ShowDialog()
d1.InitialDirectory='C:\myfiles\salesdata'
d1.ShowDialog()
#setup data source from selected file
myDataManager = Document.Datads=myDataManager.CreateFileDataSource(d1.FileName)
#replace a couple of data tables
table1 = Document.Data.Tables["T1"]
table1.ReplaceData(ds)
table2 = Document.Data.Tables["T2"]
table2.ReplaceData(ds)
table1.ReplaceData(ds)
table2 = Document.Data.Tables["T2"]
table2.ReplaceData(ds)
ConversionConversion EmoticonEmoticon