Products | Versions |
---|---|
Spotfire Developer | 7.11 and Higher |
Consider the below IronPython script which performs an Export To Pdf:
# Get the prepared report
result = Application.Document.TryGetReport("Weekly Sales report")
# Check result
if result[0] == True:
# Export the PDF
report = result[1]
exportResult = report.ExportToPdf("c:\\Source\\test.pdf")
The above script runs alright when executed from Analyst as well as from Web Player.
System.InvalidOperationException: Invalid operation 'BeginAggregatedTransaction' to the command history when in state 'Executing'.
at Spotfire.Dxp.Framework.Commands.CommandHistory.BeginAggregatedTransaction(String displayName, Boolean transient, DocumentNode node)
at Spotfire.Dxp.Framework.DocumentModel.DocumentNode.BeginTransientTransaction()
at Spotfire.Dxp.Application.Export.PreparedExportReport.PreparedExportReport.BuildResultCache(Nullable`1 maxRepetitions)
at Spotfire.Dxp.Web.Export.PreparedExportReportBuilder.BuildForExport(PreparedExportReport preparedExportReport)
at Spotfire.Dxp.Web.Export.ReportExporter.Export(Report report, Stream outputStream, String& errorMessage)
at Spotfire.Dxp.Application.Export.Report.ExportToPdf(Stream outputStream)
at Spotfire.Dxp.Application.Export.Report.ExportToPdf(String fileName)
at Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope)
at Spotfire.Dxp.Application.IronPython27.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary`2 scope, Stream outputStream)“