ironpythonspotfire

SytemError when trying to run progress bar when executing a script in spotfire


When trying this basic code snippet to test out a progress bar, I get error message "SystemError: Attempt to execute a ProgressOperation in the context of a document transaction.".

from Spotfire.Dxp.Framework.ApplicationModel import *
import traceback , time

proc=Application.GetService[ProgressService]()
def ex():
    try:
        # Wait for 5 seconds, Just to keep progress screen up for demo - 
        remove from actual code
        time.sleep(5)
        proc.CurrentProgress.ExecuteSubtask("Refreshing Data")
        Document.Data.Tables.ReloadAllData()
        proc.CurrentProgress.ExecuteSubtask("Refresh is Complete")
    except:
        traceback.print_exc()
proc.ExecuteWithProgress("Refreshing Data Manually","Trying to refresh 
all Data Tables with a progress bar", ex)

Solution

  • You need to untick 'Execute in transaction'