We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

index out of bounds exception in expression

Hi,

I tried to make an expression using a calculation for the true condition.
This causes an exception. Both Prod_BedingteUnterbrechung and Worktime are fields in the database.

Here is the errorlog:
Message : Der Index war außerhalb des Arraybereichs.
Stack Trace:    bei Syncfusion.Dashboard.Base.Engine.ExpressionParser.MoveBackWhiteSpace()
   bei Syncfusion.Dashboard.Base.Engine.ExpressionStringGeneration.FindParameter(String tempExpression)
   bei Syncfusion.Dashboard.Base.Engine.ExpressionStringGeneration.ApplyDivideByZeroError(String tempExpression)
   bei Syncfusion.Dashboard.Base.Engine.ExpressionStringGeneration.MultipleTableExpressionFormat(List`1 schemaInfoCollection, String expression, Boolean isSql, ObservableCollection`1 expressionSchemaInfoCollection)
   bei DashboardApplication.DataConnection.ViewModel.CalculatedFieldViewModel.IsValidExpression(String expression)
   bei DashboardApplication.DataConnection.ViewModel.CalculatedFieldViewModel.UpdateExpression(Object parameter)
   bei DashboardApplication.Helpers.RelayCommand.Execute(Object parameter)
   bei MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   bei System.Windows.Controls.Primitives.ButtonBase.OnClick()
   bei System.Windows.Controls.Button.OnClick()
   bei System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   bei System.Windows.Input.InputManager.ProcessStagingArea()
   bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Looking forward to your respone.

Regards,
Patrick

1 Reply

US Umapathy Shanmugam Syncfusion Team April 4, 2017 01:00 PM UTC

Hi Patrick, 
 
Thank you for contacting Syncfusion support. 
 
Sorry for the inconvenience caused due to “Index was outside the bounds of the array” error while creating an expression in our dashboard designer application. We were able to reproduce this issue in our side and this fix will be available in our upcoming release which is expected on mid of April 2017. 
 
Meanwhile you can achieve that expression in the following way. 
 
Expression1: [Worktime]/3600 
Expression2: IF([Prod_BedingteUnterbrechung]=1,[Expression1],0) 
 
Please let us know if you need any further assistance on this. 
 
Regards, 
Umapathy S. 


Loader.
Live Chat Icon For mobile
Up arrow icon