Skip to main content

Spreadsheet Service

The Spreadsheet service is a web service that can be added to an ActivePivot server to use the Excel Addin.

base URL: ws://<server>:<port>/webservices/Spreadsheet
version: v1

In the version 5.12 of ActivePivot, the Spreadsheet will be transformed from a web service to a REST Service. Its usage will not change

Add the Spreadsheet service to your ActivePivot server

The spreadsheet can be added to an ActivePivot server by including in the main configuration class ActivePivotWebServicesConfig with the other webservices. The spreadsheet service allows the Excel Addin to retrieve the version of the ActivePivot server and to manage the context values.

Adding context values

To add a custom context value, you will implement the IContextValue and a corresponding IContextValueTranslator. To expose your new context value to the Excel Addin, you need to implement a matchingIAdditionalContextMetadata depending on the type of context values you are creating.

The IAdditionalContextMetadata is also a PluginValue which allows the context service to detect the available context values and return them to the Excel add-in when they are requested. This means that you must include the @QuartetPluginValue annotation on any implementations of the IAdditionalContextMetadata interface or any of its children.

import com.activeviam.contextservice.metadata.IAdditionalContextMetadata;

@QuartetPluginValue(
intf = IAdditionalContextMetadata.class
)

Metadata interfaces

There are four interfaces that let the add-in know the context value underlying value types.

  • IAdditionalContextMetadata: Used to define the most basic context metadata which has a default String value and can return a String value from an internal IContextValue.
  • IDiscreteContextMetadata: Used to define a context metadata which has a series of discrete values. This presents a drop-down selection of values that the user can select from, an example would be a series of currency values.
  • IDoubleContextMetadata: Used to define a context metadata which is a double, and also falls within a range. This presents a slider to the user which allows them to select the correct value, or to type in a new value. An increment is also set to determine the level of precision that applies to the slider. An example for this would be a confidence level, which ranges between 0.0-1.0 or 0.0-100.0.
  • IIntegerContextMetadata: Used to define a context metadata which is an integer value and also falls within a range. This presents a slider to the user which allows them to select an integer, or to type in a new value. An example of this could be setting a multiplier to be used in a calculation which is not a fraction.

Each IAdditionalContextMetadata implementation should be linked to its IContextValueTranslator implementation by making both classes key methods return the same key.

Inferred metadata

Context values that do not have any associated IAdditionalContextMetadata, such as native Drillthrough and MDX context values, are exposed to the Excel Add-in by creating InferredMetadata using data provided by their associated translator. As with defined metadata, there are several subclasses of InferredMetadata to identify the underlying type of the context value:

  • InferredBooleanMetadata for Boolean context values
  • InferredDiscreteMetadata for discrete context values
  • InferredIntegerMetadata for integer context values
  • InferredDoubleMetadata for double context values

The base InferredMetadata class is used for basic string value context values.

We are unable to infer certain metadata from the translators, such as the maximum and minimum values for integer and double context values, so creating associated IAdditionalContextMetadata is recommended if you want to modify them in the Excel Addin.

Examples

The sandbox exposes an example of the context value defined above. You can see them in the Context values action of the Excel Addin and see how they are configured in package com.activeviam.contextservice of the sandbox project.

Example of custom context values in the sandbox