123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /****************************************************************
- ** Licensed Materials - Property of IBM
- **
- ** BI and PM: qs
- **
- ** (C) Copyright IBM Corp. 2001, 2015
- **
- ** US Government Users Restricted Rights - Use, duplication or
- ** disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- *****************************************************************/
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All Rights Reserved.
- // Cognos and the Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated) in the United States and/or other countries. IBM and the IBM logo are trademarks of International Business Machines Corporation in the United States, or other countries, or both. Other company, product, or service names may be trademarks or service marks of others.
- var COLLAPSE_UNAVAILABLE = -1;
- function CCollapse()
- {
- };
- CCollapse.prototype = new AFeatureObject();
- CCollapse.prototype.processErrorState = function ()
- {
- if (this.m_iErrorState === FEATURE_OBJECT_NO_ERROR)
- {
- return false;
- }
- else if (this.m_iErrorState === COLLAPSE_UNAVAILABLE)
- {
- dlgShowMessage("COLLAPSE_TITLE", "", "COLLAPSE_NOT_AVAILABLE");
- return true;
- }
- };
- CCollapse.prototype.setup = function (aFeatureParams)
- {
- this.m_iErrorState = FEATURE_OBJECT_NO_ERROR;
-
- var bHasMeasure = false;
- var bHasNonMeasure = false;
-
- var bHasCustomValue = false;
- var oMQMgr = goApplicationManager.getMiniQueryManager();
- var aAllColumns = oMQMgr.getAllColumns();
- for (var idxColumn = 0; idxColumn < aAllColumns.length; idxColumn++)
- {
- if (oMQMgr.isCollapsed(aAllColumns[idxColumn]) || oMQMgr.isReportExpression(aAllColumns[idxColumn]))
- {
- continue;
- }
- else if ((oMQMgr.getCalcType(aAllColumns[idxColumn]) == "range") || (oMQMgr.getCalcType(aAllColumns[idxColumn]) == "group"))
- {
- bHasCustomValue = true;
- break;
- }
- else if (oMQMgr.isMeasure(aAllColumns[idxColumn]))
- {
- bHasMeasure = true;
- }
- else
- {
- bHasNonMeasure = true;
- }
- }
- if (!bHasMeasure || !bHasNonMeasure || bHasCustomValue)
- {
- this.m_iErrorState = COLLAPSE_UNAVAILABLE;
- return;
- }
- this.execute();
- };
- CCollapse.prototype.execute = function (aParameters)
- {
- var sCommand = createCommand("M", "C");
- sendCmd(sCommand, "", true);
- };
|