【发布时间】:2015-12-27 12:45:13
【问题描述】:
我正在尝试使用 ironpython 脚本在“onPropertyChange”事件中将文档另存为库项目。 附加到属性的脚本代码:
# Import namespaces
from Spotfire.Dxp.Application import DocumentSaveSettings
from Spotfire.Dxp.Framework.Library import *
# Set the folder path and file name
folderName = "/Spotfire Test Folder/Reports"
fileName = "Test File"
# Set up the LibraryMangager and ensure that we can
# access the folder path specified
libraryManager = Document.GetService(LibraryManager)
success, libraryFolder = libraryManager.TryGetItem(folderName, LibraryItemType.Folder)
# Embed the data
Document.Data.SaveSettings.EmbedAllSourceData = 1
# Save the document back to the Library
Application.SaveAs(libraryFolder, fileName, LibraryItemMetadataSettings(), DocumentSaveSettings())
不幸的是,我收到以下错误:
处于“正在执行”状态时对命令历史记录的“BeginAggregatedTransaction”操作无效
- 脚本有问题吗?如果没有,有没有办法使用脚本或 api 函数(通过 javascript 或 ironpython)保存为库项目?
【问题讨论】:
-
网页播放器的行为与胖客户端中的行为相同吗?
-
是的,它抛出了同样的异常。
标签: ironpython spotfire