Jump to content

Hi. I just want to know whether we can create button for user to upload a file, let say it is a data frame contains 1 column containing multiple values, and automatically we can use these values as filtering in data tables in Spotfire?


Kem Azlan
Go to solution Solved by Julieta Diaz,

Recommended Posts

  • Solution

Hi Kem,

You can use this IronPython script to create a button to upload a file:

import clrimport Spotfire.Dxp.Data.DataTablefrom Spotfire.Dxp.Data import * clr.AddReference("System.Windows.Forms")from System.Windows.Forms import OpenFileDialogfrom Spotfire.Dxp.Data import *myDataManager = Document.Datad1 = OpenFileDialog()d1.InitialDirectory = baseFolderd1.ShowDialog()ds = myDataManager.CreateFileDataSource(d1.FileName)table.ReplaceData(ds)

Where the script parameters are the baseFolder (a string) and the table (a Data Table).

Hope this helps. Best regards,

Link to comment
Share on other sites

Hi Julieta. Thanks for the great help. It works but only for dashboard as local using desktop application. I tried to save dashboard with script to Library and it failed to execute. The error message is "Could not execute script 'xxxxxx': Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application."

Is it possible that we can execute the script in web client?

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...