Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Cannot read property 'create' of undefined

    I am trying to do that basic cube example from smartclient showcase using eclipse.

    my code is:


    <%@ taglib uri="isomorphic" prefix="isomorphic" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>

    <isomorphic:loadISC skin="Graphite"/>
    </head>
    <body>
    <%-- <p>servlet result was: ${message}</p> --%>
    <script>

    <isomorphic:loadDS ID="CubeGrid"/>


    var productData = [

    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Pens", metric:"Revenue", _value:10000, percentNational:25},
    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Chairs", metric:"Revenue", _value:50000, percentNational:45},
    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Monitors", metric:"Revenue", _value:120000, percentNational:49},

    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Pens", metric:"Profit", _value:2000, percentNational:25},
    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Chairs", metric:"Profit", _value:5000, percentNational:45},
    {quarter:"Q1, 2016", month:"January", region:"Western U.S.", product:"Monitors", metric:"Profit", _value:44000, percentNational:59, _hilite:"over50"},

    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Pens", metric:"Revenue", _value:8000, percentNational:20},
    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Chairs", metric:"Revenue", _value:22000, percentNational:20},
    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Monitors", metric:"Revenue", _value:20000, percentNational:8, _hilite:"under10"},

    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Pens", metric:"Profit", _value:2000, percentNational:25},
    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Chairs", metric:"Profit", _value:2000, percentNational:18},
    {quarter:"Q1, 2016", month:"January", region:"Midwest U.S.", product:"Monitors", metric:"Profit", _value:5000, percentNational:7, _hilite:"under10"},

    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Pens", metric:"Revenue", _value:22000, percentNational:55, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Chairs", metric:"Revenue", _value:40000, percentNational:36},
    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Monitors", metric:"Revenue", _value:105000, percentNational:43},

    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Pens", metric:"Profit", _value:4000, percentNational:50, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Chairs", metric:"Profit", _value:4000, percentNational:36},
    {quarter:"Q1, 2016", month:"January", region:"Eastern U.S.", product:"Monitors", metric:"Profit", _value:25000, percentNational:34},

    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Pens", metric:"Revenue", _value:12000, percentNational:23},
    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Chairs", metric:"Revenue", _value:42000, percentNational:47},
    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Monitors", metric:"Revenue", _value:160000, percentNational:40},

    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Pens", metric:"Profit", _value:4000, percentNational:23},
    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Chairs", metric:"Profit", _value:4000, percentNational:47},
    {quarter:"Q1, 2016", month:"February", region:"Western U.S.", product:"Monitors", metric:"Profit", _value:68000, percentNational:40},

    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Pens", metric:"Revenue", _value:10000, percentNational:19},
    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Chairs", metric:"Revenue", _value:12000, percentNational:13},
    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Monitors", metric:"Revenue", _value:75000, percentNational:19},

    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Pens", metric:"Profit", _value:3000, percentNational:20},
    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Chairs", metric:"Profit", _value:1000, percentNational:11},
    {quarter:"Q1, 2016", month:"February", region:"Midwest U.S.", product:"Monitors", metric:"Profit", _value:32000, percentNational:17},

    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Pens", metric:"Revenue", _value:31000, percentNational:58, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Chairs", metric:"Revenue", _value:35000, percentNational:39},
    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Monitors", metric:"Revenue", _value:164000, percentNational:41},

    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Pens", metric:"Profit", _value:8000, percentNational:53, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Chairs", metric:"Profit", _value:4000, percentNational:44},
    {quarter:"Q1, 2016", month:"February", region:"Eastern U.S.", product:"Monitors", metric:"Profit", _value:88000, percentNational:47},

    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Pens", metric:"Revenue", _value:18000, percentNational:26},
    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Chairs", metric:"Revenue", _value:25000, percentNational:54, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Monitors", metric:"Revenue", _value:220000, percentNational:40},

    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Pens", metric:"Profit", _value:9000, percentNational:29},
    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Chairs", metric:"Profit", _value:2000, percentNational:40},
    {quarter:"Q1, 2016", month:"March", region:"Western U.S.", product:"Monitors", metric:"Profit", _value:112000, percentNational:38},

    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Pens", metric:"Revenue", _value:7000, percentNational:10},
    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Chairs", metric:"Revenue", _value:6000, percentNational:13},
    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Monitors", metric:"Revenue", _value:135000, percentNational:25},

    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Pens", metric:"Profit", _value:2000, percentNational:6, _hilite:"under10"},
    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Chairs", metric:"Profit", _value:1000, percentNational:20},
    {quarter:"Q1, 2016", month:"March", region:"Midwest U.S.", product:"Monitors", metric:"Profit", _value:66000, percentNational:23},

    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Pens", metric:"Revenue", _value:44000, percentNational:64, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Chairs", metric:"Revenue", _value:15000, percentNational:33},
    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Monitors", metric:"Revenue", _value:190000,percentNational:35},

    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Pens", metric:"Profit", _value:20000, percentNational:65, _hilite:"over50"},
    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Chairs", metric:"Profit", _value:2000, percentNational:40},
    {quarter:"Q1, 2016", month:"March", region:"Eastern U.S.", product:"Monitors", metric:"Profit", _value:115000, percentNational:39}

    ];


    isc.VStack.create({
    width: "100%",
    membersMargin: 10,
    members: [
    isc.CubeGrid.create({
    ID: "basicCubeGrid",
    data: productData,
    width: "100%",
    hideEmptyFacetValues: true,

    valueFormat: "\u00A4,0.00",

    columnFacets: ["quarter", "month", "metric"],
    rowFacets: ["region", "product"],

    // configure export colors
    exportFacetTextColor: "blue",
    exportFacetBGColor: "yellow",

    exportColumnFacetTextColor: "red",
    exportColumnFacetBGColor: "#44FF44",

    exportDefaultBGColor: "#FFDDAA",
    }),
    isc.Button.create({
    title: "Export",
    click: function (){
    basicCubeGrid.exportClientData({exportAs: "xls"});
    }
    })
    ]
    });

    </script>

    </body>
    </html>






    and error

    ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1190 *12:34:41.047:WARN:Log:TypeError: Cannot read property 'create' of undefined
    Stack from error.stack:
    <anonymous>(<no args: exited>) @ abcd:192:15

    isc.B.push.isc.A.addToMasterLog @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1190
    isc_c_Log_addLogMessage @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1189
    isc_c_Log_log @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1182
    logMessage @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1171
    logWarn @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1171
    isc__debug__reportJSErrorStack @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1144
    isc__debug__reportJSError @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1144
    window.onerror @ ISC_Core.js?isc_version=v11.1p_2017-07-09.js:1231
    abcd:192 Uncaught TypeError: Cannot read property 'create' of undefined
    at abcd:192
    (anonymous) @ abcd:192


    How to fix it? Whenever I am trying to use any Facet related properties I am getting this error.

    Last edited by nilatpal; 6 Oct 2017, 02:56.

    #2
    Most likely you simply did not load the Analytics module (ISC_Analytics.js), so isc.CubeGid is not defined.

    This is easily understood using the developer tools built into any browser, by just stopping on errors and looking at current variable values.

    Comment


      #3
      I have a licensed enterprise version but there is no module named isc_analytics in it. How can I get it? is there any update? I have downloaded evaluation version for this as it contains it and the example is working fine.

      Comment


        #4
        The Analytics Module is a separately purchased module. To try it out without purchasing it, download the Evaluation Edition.

        Comment

        Working...
        X