function QueryViewer(){this.enableServerDebug=!1;this.oat_element="";this.IsExternalQuery=!1;this.ExternalQueryResult="[]";this.UseRecordsetCache=this.ServerPagingForPivotTable=this.ServerPagingForTable=!0;this.MaximumCacheSize=100;this.MinutesToKeepInRecordsetCache=5;this.ReturnSampleData=!1;this.SetDragAndDropData=function(a){this.DragAndDropData=a};this.GetDragAndDropData=function(){return this.DragAndDropData};this.SetItemExpandData=function(a){this.ItemExpandData=a};this.GetItemExpandData=function(){return this.ItemExpandData};
this.SetItemCollapseData=function(a){this.ItemCollapseData=a};this.GetItemCollapseData=function(){return this.ItemCollapseData};this.SetFilterChangedData=function(a){this.FilterChangedData=a};this.GetFilterChangedData=function(){return this.FilterChangedData};this.SetItemClickData=function(a){this.ItemClickData=a};this.GetItemClickData=function(){return this.ItemClickData};this.SetItemDoubleClickData=function(a){this.ItemDoubleClickData=a};this.GetItemDoubleClickData=function(){return this.ItemDoubleClickData};
this.SetParameters=function(a){this.Parameters=a};this.GetParameters=function(){return this.Parameters};this.SetAxes=function(a){this.Axes=a};this.GetAxes=function(){return this.Axes};this.show=function(){if(!gx.lang.gxBoolean(this.AvoidAutomaticShow)||gx.lang.gxBoolean(this.ExecuteShow))gx.lang.gxBoolean(this.Visible)?(this.getContainerControl().style.display="",qv.collection[this.userControlId()]=this,this._isAutorefresh=!1,this.realShow()):this.getContainerControl().style.display="none";gx.lang.gxBoolean(this.AvoidAutomaticShow)&&
(this.ExecuteShow=!1)};this.GetMetadata=function(){switch(this.RealType){case "Card":return qv.card.GetMetadataCard(this);case "Chart":return qv.chart.GetMetadataChart(this);default:return qv.pivot.GetMetadataPivot(this)}};this.GetData=function(){switch(this.RealType){case "Card":return qv.card.GetDataCard(this);case "Chart":return qv.chart.GetDataChart(this);default:return qv.pivot.GetDataPivot(this)}};this.GetFilteredData=function(){switch(this.RealType){case "Card":return qv.card.GetDataCard(this);
case "Chart":return qv.chart.GetDataChart(this);default:return qv.pivot.GetFilteredDataPivot(this)}};this.NotifyMetadata=function(){var a=this.GetMetadata();qv.util.ExecuteTracker("CollQueryViewerAxes.Axis",a)};this.NotifyData=function(){var a=this.GetData(),b={};b.XmlData=a;qv.util.ExecuteTracker("QueryViewerData",b)};this.NotifyFilteredData=function(){var a=this.GetFilteredData(),b={};b.XmlData=a;qv.util.ExecuteTracker("QueryViewerFilteredData",b)};this.NextPage=function(){this.oat_element.moveToNextPage()};
this.FirstPage=function(){this.oat_element.moveToFirstPage()};this.PreviousPage=function(){this.oat_element.moveToPreviousPage()};this.LastPage=function(){this.oat_element.moveToLastPage()};this.Select=function(a){if(this.SelectionAllowed()){for(var b=0,c=0;c<a.length;c++){var d=this.GetAxisByName(a[c].Name);null!=d?(a[c].DataField=d.DataField,b+=1):a[c].DataField&&delete a[c].DataField}if(0<b)switch(this.RealType){case "Chart":qv.chart.Select(this,a);break;case "Table":case "PivotTable":qv.pivot.Select(this,
a)}else switch(this.RealType){case "Chart":qv.chart.Deselect(this);break;case "Table":case "PivotTable":qv.pivot.Deselect(this)}}};this.CanRefreshControl=function(){return this._ControlRenderedTo==this.RealType};this.IsAutoResize=function(){return"Chart"==this.RealType?!1:gx.lang.gxBoolean(this.AutoResize)};this.SetContainerSize=function(a){if(this.IsAutoResize())switch(this.AutoResizeType){case "Vertical":!gx.util.browser.isIE()&&""!=this.Width&&(a.style.width=gx.dom.addUnits(this.Width));break;
case "Horizontal":""!=this.Height&&(a.style.height=gx.dom.addUnits(this.Height))}else if(""!=this.Width&&(a.style.width=gx.dom.addUnits(this.Width)),""!=this.Height)a.style.height=gx.dom.addUnits(this.Height);if(!this.IsAutoResize()||this.IsAutoResize()&&"Vertical"==this.AutoResizeType&&!gx.util.browser.isIE())a.style.overflow="auto"};this.realShow=function(){gx.lang.gxBoolean(this.IsExternalQuery)||qv.util.showActivityIndicator(this);this.calculateRealOutputType(function(){var a=document.getElementById(this.ContainerName);
this.SetContainerSize(a);this.CanRefreshControl()||(a=qv.util.dom.getEmptyContainer(this),qv.util.dom.createDiv(a,this.userControlId(),"","",{width:gx.dom.addUnits(this.Width),height:gx.dom.addUnits(this.Height)},""));gx.lang.gxBoolean(this.RememberLayout)&&(!this._isAutorefresh&&""!=this.AutoRefreshGroup)&&qv.util.autorefresh.LoadAxesAndParametersState(this);"Table"==this.RealType||"PivotTable"==this.RealType?qv.pivot.tryToRenderPivotTable(this):"Card"==this.RealType?qv.card.tryToRenderCard(this):
qv.chart.tryToRenderChart(this)}.closure(this))};this.calculateRealOutputType=function(a){"Default"==this.Type?this.getDefaultOutput(function(b,c){"Table"!=b&&"PivotTable"!=b&&"Card"!=b?(c.RealType="Chart",c.RealChartType=b):c.RealType=b;a()}.closure(this)):(this.RealType=void 0!=this.Type&&""!=this.Type?this.Type:"Table",this.RealChartType=void 0!=this.ChartType&&""!=this.ChartType?this.ChartType:"",a())};this.userControlId=function(){return this.ContainerName.replace("Container","")+"_"+this.ControlName};
this.ExternalQueryResultObj=function(){if(void 0==this._ExternalQueryResultObj||this.ExternalQueryResult!=this._LastExternalQueryResult)this._ExternalQueryResultObj=eval("("+this.ExternalQueryResult+")"),this._LastExternalQueryResult=this.ExternalQueryResult;return this._ExternalQueryResultObj};this.GetAxisByName=function(a){for(var b=0;b<this.Metadata.Axes.length;b++)if(this.Metadata.Axes[b].Name==a)return this.Metadata.Axes[b];return null};this.SelectionAllowed=function(){return gx.lang.gxBoolean(this.AllowSelection)&&
"Card"!=this.RealType&&!("Chart"==this.RealType&&("CircularGauge"==this.RealChartType||"LinearGauge"==this.RealChartType))};this.calculatePivottableData=qv.services.createAsyncServerCallFn(this,qv.services.url.getDataURL,qv.services.postInfo.Data,"GetData");this.calculatePivottableMetadata=qv.services.createAsyncServerCallFn(this,qv.services.url.getMetadataURL,qv.services.postInfo.Metadata,"GetMetadata",qv.util.css.replaceCssClasses);this.getDefaultOutput=qv.services.createAsyncServerCallFn(this,
qv.services.url.getDefaultOutputURL,qv.services.postInfo.DefaultOutput,"GetDefaultOutput");this.getQueryParameters=qv.services.createAsyncServerCallFn(this,qv.services.url.getQueryParametersURL,qv.services.postInfo.getQueryParameters,"GetQueryParameters");this.getAttributeValues=qv.services.createAsyncServerCallFn(this,qv.services.url.getAttributeValuesURL,qv.services.postInfo.AttributeValues,"GetAttributeValues");this.getPageDataForTable=qv.services.createAsyncServerCallFn(this,qv.services.url.getPageDataForTableURL,
qv.services.postInfo.TablePageData,"GetPageDataForTable");this.getPageDataForPivotTable=qv.services.createAsyncServerCallFn(this,qv.services.url.getPageDataForPivotTableURL,qv.services.postInfo.PivotTablePageData,"GetPageDataForPivotTable");this.getRecordsetCacheKey=qv.services.createAsyncServerCallFn(this,qv.services.url.getRecordsetCacheKeyURL,qv.services.postInfo.RecordsetCacheKey,"GetRecordsetCacheKey");this.getPivottableDataSync=function(){return qv.services.CallServerSync(this,qv.services.url.getDataURL,
qv.services.postInfo.Data)};this.getAttributeValuesSync=function(a){return qv.services.CallServerSync(this,qv.services.url.getAttributeValuesURL,qv.services.postInfo.AttributeValues,a)};this.getPageDataForTableSync=function(a){return qv.services.CallServerSync(this,qv.services.url.getPageDataForTableURL,qv.services.postInfo.TablePageData,a)}};
