如何使用fireEvent在icCube中设置选择

如何使用fireEvent在icCube中设置选择,iccube,iccube-reporting,Iccube,Iccube Reporting,我有一个带有维度成员的multiselect filter小部件,可以将其用作mdx中的过滤器。在mdx中使用@{filter)可以很好地工作。就好像过滤器是每个用户唯一的一样,我希望将其存储在数据库中,并在用户登录时加载它。这可以很好地工作,并将过滤器作为JSON对象获取: data = [{ "servicenumbers": [{ "name": "+31880440723", "uniquename": "[Inkomend

我有一个带有维度成员的multiselect filter小部件,可以将其用作mdx中的过滤器。在mdx中使用@{filter)可以很好地工作。就好像过滤器是每个用户唯一的一样,我希望将其存储在数据库中,并在用户登录时加载它。这可以很好地工作,并将过滤器作为JSON对象获取:

data = [{ "servicenumbers": [{ "name": "+31880440723", "uniquename": "[Inkomend nummer].[Inkomend nummer].[Nummer].&[76]&[2308]" }, { "name": "+31880440747", "uniquename": "[Inkomend nummer].[Inkomend nummer].[Nummer].&[76]&[2329]" }, { "name": "+31880440758", "uniquename": "[Inkomend nummer].[Inkomend nummer].[Nummer].&[76]&[3670]" }, { "name": "+31880440727", "uniquename": "[Inkomend nummer].[Inkomend nummer].[Nummer].&[76]&[2312]" }] }] 数据=[{ “服务编号”:[{ “名称”:“+3188040723”, “uniquename:“[Inkomend nummer].[Inkomend nummer].[nummer].[76].[2308]” }, { “名称”:“+3188040747”, “uniquename:“[Inkomend nummer].[Inkomend nummer].[nummer].[76].[2329]” }, { “名称”:“+3188040758”, “uniquename:“[Inkomend nummer].[Inkomend nummer].[nummer].[76].[3670]” }, { “名称”:“+3188040727”, “uniquename:“[Inkomend nummer].[Inkomend nummer].[nummer].[76].[2312]” }] }] 在我的javascriptcode中,我有一个“fireEvent”事件来实际设置过滤器。代码:

function consumeEvent( context, event ) { var $report = context.$report; var fireEvent = context.fireEvent.bind(context); ... some code ... fireEvent('filter',buildEvent(data)); } 函数consumerevent(上下文,事件){ var$report=上下文。$report; var firevent=context.firevent.bind(context); ... 一些代码 ... fireEvent('filter',buildEvent(数据)); } 函数构建事件(sel) { 返回{ fireMdxByDefault:错误, isGlobalFilter:是的, classID:即event.SetSelectionEvent, 构造函数:函数w(A,B,z){x.call(this,B,z);this.classID=“viz.event.SetSelectionEvent”;this.selection=A}, 标题:函数(){if(this.selection&&this.selection.length>0){return ic3.asMdxSet(this.selection,“name”,false,true)}else{return”“}, asMdx:function(){if(this.selection&&this.selection.length>0){return ic3.asMdxSet(this.selection,“uniqueName”)}else{return null}, asFilterInitialSelection:function(){if(this.selection&&this.selection.length>0){return ic3.arrayProps(this.selection,“uniqueName”)}否则{return”“}, getSelectedItems:function(){返回this.selection}, isSelectionEvent:函数(){return true}, isGlobalFilter:function(){返回this.isGlobalFilter}, isEmptyEvent:函数(){return false}, 值:函数(){返回this.asMdx()}, asSet:function(){返回this.asMdx().replace(/^\(/,“{”).replace(/\)$/,“}”)}, asDefaultValue:function(){返回this.asFilterInitialSelection()}, 报告参数:函数:函数:函数:{var H={{{};H.rpe=1;若(该)函数(该.ISmptytyEvent(){H.nil=真实}其他{var A=该.描述参数:函数:函数:{var H={{H.H.H={{H.H.nil=true=真实}}其他{其他{VAA=A A=该.该.标题:::::::;若(若(A!=={{A={{{{H.A={{{{{H.A={{{{H.H.H.H.H.H.H.H.H.H.H.H={{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{H.H.H.H.H.H.H.H.H.H==null){H.sel=B}}返回H}, 选择:sel.ServiceNumber }; } 如果我在MDX@{filter}中使用“filter”,则会在查询中应用该过滤器。但是,如果我在我的filter小部件中将其用作“do set Selection”,则不会应用该选择,并且不会选择任何内容


是否有人建议如何进行此操作?

您正在使用哪个版本的icCube报告?您可以在顶部菜单“管理”-“版本”下找到它“我正在使用的版本:icCube报告:5.1.8(6:2797)您正在使用哪个版本的icCube报告?您可以在顶部菜单“管理”-“版本”下找到它我使用的是版本:icCube Reporting:5.1.8(6:2797) function buildEvent(sel) { return { fireMdxByDefault: false, isGlobalFilter_: true, classID: viz.event.SetSelectionEvent, constructor: function w(A,B,z){x.call(this,B,z);this.classID="viz.event.SetSelectionEvent";this.selection=A}, caption: function (){if(this.selection&&this.selection.length>0){return ic3.asMdxSet(this.selection,"name",false,true)}else{return""}}, asMdx: function (){if(this.selection&&this.selection.length>0){return ic3.asMdxSet(this.selection,"uniqueName")}else{return null}}, asFilterInitialSelection: function (){if(this.selection&&this.selection.length>0){return ic3.arrayProps(this.selection,"uniqueName")}else{return""}}, getSelectedItems: function (){return this.selection}, isSelectionEvent: function (){return true}, isGlobalFilter: function (){return this.isGlobalFilter_}, isEmptyEvent: function (){return false}, value: function (){return this.asMdx()}, asSet: function (){return this.asMdx().replace(/^\(/,"{").replace(/\)$/,"}")}, asDefaultValue: function (){return this.asFilterInitialSelection()}, asReportParam: function (){var H={};H.rpe=1;if(this.isEmptyEvent()){H.nil=true}else{var A=this.caption();if(A!==null){H.dft=A}var D=this.value();if(D!==null){H.val=D}var z=this.asMdx();if(z!==null){H.mdx=z}var x=this.asFilterInitialSelection();if(x!==null){H.fis=x}if(this.isSelectionEvent()){var B=this.getSelectedItems();if(B!==null){H.sel=B}}}return H}, selection: sel.servicenumbers }; }