iccube - icCube Reporting - 使用事件的标签:格式和语法
问题描述
在标签框中使用事件变量的正确语法是什么(例如标题标题)。
有一个定义的事件(例如测试),有什么可能的用途?以下表达式的含义是什么?
@{Test:'替代文本'!} @{Test}
还有其他可用的功能吗?
解决方案
icCube 中的事件是主要实现两种方法的对象(基类是 viz.event.Event):
- caption() - 返回事件的标题/名称,例如意大利为国家 MDX 成员
- asMdx() - 返回 mdx 唯一名称(如果没有,则为标题),例如 [Country].[Italy]
因此,当您定义事件侦听器@{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;
}
推荐阅读
- python - Pandas 说每一列都是一个对象,尽管我认为它是一个整数
- python - python中是否有“if not<”或“if not >”命令?
- node.js - node js npm包安装未完成
- python - readAll() 或 readAllStandardOutput() 在执行之前也返回一个空字符串
- amazon-web-services - 尝试绑定地址时出错 ('0.0.0.0' 443) 权限被拒绝 aws
- r - R中的Mapview和太平洋地区的预测/ crs问题
- javascript - 在 Google 表格上使用 JavaScript 获取 URL 响应代码
- kdb - 给定一个现有表,生成用于定义具有相同架构的空表的代码
- azure - 删除子网失败
- mysql - 创建与其他 2 个表不同的第 3 个表 SQL