如何添加按钮以及每当用户点击按钮时数据重新加载。
用户也应该知道数据刷新的时间。
答案 0 :(得分:3)
您可以使用此python脚本,如找到here。
from System.Collections.Generic import List, Dictionary
from Spotfire.Dxp.Data import DataTable
from System.Collections import ArrayList
#Refreshing a single Data table:
dataTable.Refresh() // where dataTable is a script parameter of type DataTable
#Refreshing multiple tables:
#Note that more than one table can be added to the List object.
tables = ArrayList()
tables.Add(Document.Data.Tables["DataTable1"])
tables.Add(Document.Data.Tables["DataTable2"])
Document.Data.Tables.Refresh(tables)
#As such DataTableCollection.Refresh Method refreshes the given tables in dependency order.
#OR
Document.Data.Tables.RefreshAsync(tables)
#And DataTableCollection.RefreshAsync Method (IEnumerable< DataTable> ) refreshes the given tables in dependency order.
#Tables that have asynchronous refresh (i.e. Data On Demand and Data Functions) and tables that depend on them will be refreshed
#in later transactions.
# Another possible option:
Tbls = List[DataTable]()
Tbls.Add(Document.Data.Tables["DataTable1"])
Tbls.Add(Document.Data.Tables["DataTable2"])
for i in Tbls:
Document.Data.Tables.Refresh([i])
为了让用户知道数据刷新的时间,只需设置一个文档属性,其中包含当前日期/时间和表面文本区域中的文档属性。运行上述脚本时,日期/时间将更新。
另外,请查看位于here的Python API页面(对于7.6,但也可以找到更新的7.12 API)。虽然它以一种令人沮丧的方式组织,但您可以感受到可以在脚本中调用的方法和类,以编程方式执行各种操作。