Document property value doesn't get updated automatically. Any suggestions?
I have a script that sets a document property to the value of the Month from the data table and this property I'm displaying it in my bar chart title to show the no of products sold for the current Month.
The issue that I'm facing is that the document property doesn't get updated, it still retains the old value until we click on the Run script manually).
Is there a way to fix this?
Below is the script that I'm using:
from Spotfire.Dxp.Data import RowSelection,DataValueCursor
from Spotfire.Dxp.Data import IndexSet,DataPropertyClass
from Spotfire.Dxp.Data import DataPropertyClass
from System import String
#Identify the number of rows in the table
#Set the Index set to True for particular rows in table
rowsToInclude = IndexSet(rowCount,True)
cursor = DataValueCursor.CreateFormatted(dTable.Columns["CurrentMonthName"])
for row in dTable.GetRows(rowsToInclude,cursor):
rowIndex = row.Index
RepMonth = cursor.CurrentValue
Document.Properties["currmonth"] = RepMonth