icCube Reporting — метки с использованием событий: форматирование и синтаксис

Каков правильный синтаксис для использования переменной события в полях меток (например, заголовок заголовка).

Имея определенное событие (например, тест), каково возможное использование? Что означает следующее выражение?

@{Тест:'Альтернативный текст'!} @{Тест}

Есть ли другие доступные функции?


person Luca Ligios    schedule 19.07.2019    source источник


Ответы (1)


События в icCube — это объекты (базовый класс — а именно.event.Event), которые реализуют в основном два метода:

  • caption() - возвращает заголовок/название события, например. Италия для страны-члена MDX
  • asMdx() - возвращает уникальное имя mdx (заголовок, если его нет), например. [Страна].[Италия]

Поэтому, когда вы определяете прослушиватель событий @{eventName}, он будет изменен значением caption(), если только вы не находитесь в выражении MDX, где оно изменено значением asMdx().

Вы можете украсить свое мероприятие тремя способами.

@{eventName!emptyValue}         -> if the event is empty, returns  the string 'emptyValue' (without single quotes)
@{eventName:eventFunction}      -> calls eventObject.eventFunction , e.g. @{event:asMdx}
@{eventName:'valueIfNotEmpty'}  -> if the event exists, return the string 'valueIfNotEmpty' (without single quotes)

Дополнительную информацию см. в документе.

Поскольку это javascript, вы можете добавлять свои собственные методы к объекту класса (например, используя хук On Send Event в виджете - значок JS)

Интерфейс, который реализуют все события:

   export interface IEvent {
        /**
         * Return true if the event is empty.
         * @returns {boolean}
         */
        isEmptyEvent():boolean;

        /**
         * Returns the caption of the event.
         * @returns {string}
         */
        caption():string;

        /**
         * Returns the value of the event.
         * @returns {string}
         */
        value():any;

        /**
         * Returns the event value as MDX expression.
         * @returns {string}
         */
        asMdx():string;

        /**
         * Return the event value key
         * @return {string}
         */
        asKey():string;

        /**
         * Return the string representation of member key with quotes. If multiple keys present it returns: 'key1', 'key2', 'key3'
         * @return {string}
         */
        asQuotedKey():string;

        /**
         * Return the string representation of member captions with quotes. If multiple keys present it returns: 'name1, 'name2', 'name3'
         * @return {string}
         */
        asQuotedCaption():string;

        /**
         * Return the array of event keys
         * @return {Array}
         */
        asKeyArray():string[];

        /**
         * Returns the event value es MDX set expression.
         * @returns {string}
         */
        asSet():string;

        /**
         * Returns the event value as filter initial selection.
         * @returns {any}
         */
        asFilterInitialSelection():any;

        /**
         * Return true if the event is selection event. Used for type check.
         * @returns {boolean}
         */
        isSelectionEvent():boolean;

        /**
         * Returns the event value as an array.
         * @returns {any[]}
         */
        getSelectedItems():any[];

        /**
         * Returns a serialized event object.
         * @returns {EventGuts}
         */
        asReportParam():EventGuts;
    }
person ic3    schedule 24.07.2019