Jump to content
We've recently updated our Privacy Statement, available here. ×

The progress bar doesn't display until the end of the data reload - IronPython


Priyank Dwivedi

Recommended Posts

I intend to show a progress bar using SPotfire's "ProgressService" and refer to this article :

https://community.spotfire.com/s/article/How-to-Add-Progress-Bar-and-Cancellation-Option-when-Executing-IronPython-Scripts-in-TIBCO-Spotfire

In my scenario, the table that is being reloaded is added as an 'information link' and runs an SQL procedure based on certain parameters. The code seems to work fine but the progress bar dialog shows up for "5" seconds based on the time.sleep syntax.

There are two issues with this code:

1) The data refresh only starts after the dialog is automatically closed down (timer = 5 sec)

2) How can I keep the dialog until the data refresh is completed?

# Tables(s) to refresh - change/add more if requiredTbls = List[DataTable]()Tbls.Add(Document.Data.Tables['PD_OUTLOOK_GROSS_ROLLUP_TBL'])  ps = Application.GetService[ProgressService]()def ex(): try:  ps.CurrentProgress.ExecuteSubtask("Retrieving and Formatting Data") Document.Data.Tables.RefreshAsync(Tbls) time.sleep(5) ps.CurrentProgress.TryReportProgress() ps.CurrentProgress.CheckCancel() print('A')  except: #pass traceback.print_exc() print('B')ps.ExecuteWithProgress("Data Retrieval", "Retrieving and Formatting Data for Report", ex)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...