Facing Issue while using LayoutDefinition.BeginSideBySideSection()method.

I am facing an issue with the visualization layouts script.  when i applied below script got an error message.

from Spotfire.Dxp.Application.Visuals import VisualTypeIdentifiers, BarChart
from Spotfire.Dxp.Application.Layout import TileMode,LayoutDefinition
from Spotfire.Dxp.Application.Visuals import *
#

ld= LayoutDefinition.BeginSideBySideSection
for vis in  Application.Document.ActivePageReference.Visuals:
 ld.Add(vis)

ReportPage.ApplyLayout(ld)
LayoutDefinition.EndSection

Application.Document.ActivePageReference.ApplyLayout(ld)

Error:-

  Traceback (most recent call last):
  File "Spotfire.Dxp.Application.ScriptSupport", line unknown, in ExecuteForDebugging
  File "", line 8, in
AttributeError: 'method_descriptor' object has no attribute 'Add'

System.MissingMemberException: 'method_descriptor' object has no attribute 'Add'
   at _stub_$2670##2670(Closure , CallSite , Object )
   at Microsoft.Scripting.Actions.MatchCaller.Call1[T0,TRet](Func`3 target, CallSite site, Object[] args)
   at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)
   at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T,T0,TRet](CallSite site, T0 arg0)
   at _stub_$2669##2669(Closure , CallSite , Object , CodeContext )
   at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args)
   at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args)
   at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
   at $2663##2663(Closure , Scope , LanguageContext )
   at Spotfire.Dxp.Application.ScriptSupport.IronPythonScriptEngine.ExecuteForDebugging(String scriptCode, Dictionary`2 scope, Stream outputStream)

      

as specied in LayoutDefinition. Add Method we have to Adds the specified visual  to the current section. BeginStackedSection() or BeginSideBySideSection() should be called prior to this. I did the same but got error. So please provide how to Implement Layout Functionality for Visualization

(1) Answer

Login