Announcement

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

    SmartgwtEE-5.0d Basic CubeGrid Example exports empty excel file

    PROBLEM: The Basic CubeGrid example with added export to excel example produces an excel download file that's empty. "Sheet0" has all it's cells empty.

    Be sure your post includes:

    1. SmartgwtEE-5.0d: SNAPSHOT_v10.0d_2014-04-27/Enterprise Deployment 2014-04-27

    2. Firefox and tomcat server

    The example is from the sample in smartgwtee-5.0d:

    Code:
            final CubeGrid cubeGrid = new CubeGrid();
            //in order to enable charting, the Drawing module must be present
            if(SC.hasDrawing()) {
                cubeGrid.setEnableCharting(true);
            }
            cubeGrid.setData(ProductRevenueData.getData());
    
            cubeGrid.setWidth100();
            cubeGrid.setHeight100();
            cubeGrid.setHideEmptyFacetValues(true);
            cubeGrid.setShowCellContextMenus(true);
    
            final NumberFormat numberFormat = NumberFormat.getFormat("0,000");
    
            cubeGrid.setCellFormatter(new CellFormatter() {
                public String format(Object value, ListGridRecord record, int rowNum, int colNum) {
                    if (value == null) return null;
                    try {
                        return numberFormat.format(((Number) value).longValue());
                    } catch (Exception e) {
                        return value.toString();
                    }
                }
            });
    
            cubeGrid.setColumnFacets("quarter", "month", "metric");
            cubeGrid.setRowFacets("region", "product");
    
            Button exportButton = new Button("Export");
            exportButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    DSRequest dsRequestProperties = new DSRequest();
                    dsRequestProperties.setExportAs(ExportFormat.XLS);
                    dsRequestProperties.setExportDisplay(ExportDisplay.DOWNLOAD);
                    cubeGrid.exportClientData(dsRequestProperties);            
                }
            });
    
            VLayout layout = new VLayout();
            layout.setWidth100();
            layout.setHeight100();
            layout.addMember(exportButton);
            layout.addMember(cubeGrid);
    
            layout.draw();
    Here is a snippet of the logs regarding the excel download:

    Code:
    === 2014-04-30 16:57:05,178 [ec-6] DEBUG RPCManager - Processing 1 requests.
    === 2014-04-30 16:57:05,179 [ec-6] DEBUG RPCManager - Request #1 (RPCRequest) data: {
        appID:"isc_builtin",
        className:"builtin",
        methodName:"downloadClientExport",
        arguments:[
            [
                {
                    region:"Western U.S.\r\n\r\n",
                    product:"Pens\r\nChairs\r\nMonitors",
                    "Q1, 2002 - January - Revenue":"10,000\r\n50,000\r\n120,000",
                    "Q1, 2002 - January - Profit":"2,000\r\n5,000\r\n44,000",
                    "Q1, 2002 - February - Revenue":"12,000\r\n42,000\r\n160,000",
                    "Q1, 2002 - February - Profit":"4,000\r\n\r\n68,000",
                    "Q1, 2002 - March - Revenue":"18,000\r\n25,000\r\n220,000",
                    "Q1, 2002 - March - Profit":"9,000\r\n2,000\r\n112,000"
                },
                {
                    region:"Midwest U.S.\r\n\r\n",
                    product:"Pens\r\nChairs\r\nMonitors",
                    "Q1, 2002 - January - Revenue":"8,000\r\n22,000\r\n20,000",
                    "Q1, 2002 - January - Profit":"2,000\r\n\r\n5,000",
                    "Q1, 2002 - February - Revenue":"10,000\r\n12,000\r\n75,000",
                    "Q1, 2002 - February - Profit":"3,000\r\n1,000\r\n32,000",
                    "Q1, 2002 - March - Revenue":"7,000\r\n6,000\r\n135,000",
                    "Q1, 2002 - March - Profit":"2,000\r\n1,000\r\n66,000"
                },
                {
                    region:"Eastern U.S.\r\n\r\n",
                    product:"Pens\r\nChairs\r\nMonitors",
                    "Q1, 2002 - January - Revenue":"22,000\r\n40,000\r\n105,000",
                    "Q1, 2002 - January - Profit":"4,000\r\n\r\n25,000",
                    "Q1, 2002 - February - Revenue":"31,000\r\n35,000\r\n164,000",
                    "Q1, 2002 - February - Profit":"8,000\r\n4,000\r\n88,000",
                    "Q1, 2002 - March - Revenue":"44,000\r\n15,000\r\n190,000",
                    "Q1, 2002 - March - Profit":"20,000\r\n2,000\r\n115,000"
                }
            ],
            "xls",
            "export",
            "download",
            {
                exportAs:"xls",
                exportFilename:"export",
                exportRawValues:false,
                exportCurrencySymbol:"$",
                exportFields:[
                ],
                exportOtherFields:{
                }
            }
        ],
        is_ISC_RPC_DMI:true
    }
    === 2014-04-30 16:57:05,179 [ec-6] INFO  IDACall - Performing 1 operation(s)
    === 2014-04-30 16:57:05,182 [ec-6] DEBUG RPCDMI - appConfig: isc.Application.create({
        rpcBindings:[
            {
                ID:"builtin",
                className:"com.isomorphic.rpc.BuiltinRPC",
                visibleMethods:[
                    {
                        name:"downloadWSDL"
                    },
                    {
                        name:"downloadClientContent"
                    },
                    {
                        name:"downloadClientExport"
                    },
                    {
                        name:"xmlToJS"
                    },
                    {
                        name:"uploadProgressCheck"
                    },
                    {
                        name:"saveFile"
                    },
                    {
                        name:"appendToFile"
                    },
                    {
                        name:"loadFile"
                    },
                    {
                        name:"deleteFile"
                    },
                    {
                        name:"loadSharedXML"
                    },
                    {
                        name:"saveSharedXML"
                    },
                    {
                        name:"getAvailableScriptEngines"
                    },
                    {
                        name:"devConsoleEvalServerScript"
                    },
                    {
                        name:"evalJava"
                    },
                    {
                        name:"getLogNames"
                    },
                    {
                        name:"getLogEntries"
                    },
                    {
                        name:"clearLogEntries"
                    },
                    {
                        name:"getLogThresholds"
                    },
                    {
                        name:"setLogThreshold"
                    },
                    {
                        name:"setTemporaryLogThreshold"
                    },
                    {
                        name:"revertTemporaryLogThresholds"
                    },
                    {
                        name:"getPdfObject"
                    },
                    {
                        name:"exportImage"
                    },
                    {
                        name:"areServerTimingsTracked"
                    },
                    {
                        name:"trackServerTimings"
                    }
                ]
            },
            {
                ID:"builtin_tools",
                className:"com.isomorphic.tools.BuiltinRPC",
                visibleMethods:[
                    {
                        name:"getDataSourceFromTable"
                    },
                    {
                        name:"getDataSourceJSONFromTable"
                    },
                    {
                        name:"getDataSourceFromHibernateMapping"
                    },
                    {
                        name:"getDataSourceJSONFromHibernateMapping"
                    },
                    {
                        name:"getTables"
                    },
                    {
                        name:"getFieldsFromTable"
                    },
                    {
                        name:"getBeanFields"
                    },
                    {
                        name:"getHibernateBeans"
                    },
                    {
                        name:"getDatabaseProductNameAndVersion"
                    },
                    {
                        name:"getDatabaseTableTypes"
                    },
                    {
                        name:"setAttributes"
                    },
                    {
                        name:"clearAttributes"
                    },
                    {
                        name:"getAttributes"
                    },
                    {
                        name:"getAttribute"
                    },
                    {
                        name:"getDataSourceConfigFromJavaClass"
                    },
                    {
                        args:"cName",
                        language:"groovy",
                        name:"getJavaSource",
                        script:"\n                    if (!com.isomorphic.auth.DevModeAuthFilter.devModeAuthorized(request)) throw new Exception(\"Not Authorized\");                    \n                    //import org.apache.bcel.Repository;\n\n                    try {\n                        return org.apache.bcel.Repository.lookupClass(cName).toString();\n                    } catch (Throwable e) {\n                        return \"Unable to reverse engineer class \"+cName+\": \"+e.getMessage();\n                    }\n                "
                    },
                    {
                        name:"loadDataSource"
                    },
                    {
                        name:"dsFromXML"
                    },
                    {
                        name:"dsConfigFromXML"
                    },
                    {
                        name:"getDefinedDataSources"
                    }
                ]
            },
            {
                ID:"builtin_adminconsole",
                className:"com.isomorphic.tools.AdminConsole",
                visibleMethods:[
                    {
                        name:"getDefinedDatabases"
                    },
                    {
                        name:"testDB"
                    },
                    {
                        name:"saveDBConfig"
                    },
                    {
                        name:"setDefaultDB"
                    },
                    {
                        name:"importDataSources"
                    },
                    {
                        name:"discoverJNDIDatabases"
                    }
                ]
            }
        ]
    })
    
    === 2014-04-30 16:57:05,184 [ec-6] INFO  BuiltinRPC - Export data passed to server:
    [
        {
            region:"Western U.S.\r\n\r\n",
            product:"Pens\r\nChairs\r\nMonitors",
            "Q1, 2002 - January - Revenue":"10,000\r\n50,000\r\n120,000",
            "Q1, 2002 - January - Profit":"2,000\r\n5,000\r\n44,000",
            "Q1, 2002 - February - Revenue":"12,000\r\n42,000\r\n160,000",
            "Q1, 2002 - February - Profit":"4,000\r\n\r\n68,000",
            "Q1, 2002 - March - Revenue":"18,000\r\n25,000\r\n220,000",
            "Q1, 2002 - March - Profit":"9,000\r\n2,000\r\n112,000"
        },
        {
            region:"Midwest U.S.\r\n\r\n",
            product:"Pens\r\nChairs\r\nMonitors",
            "Q1, 2002 - January - Revenue":"8,000\r\n22,000\r\n20,000",
            "Q1, 2002 - January - Profit":"2,000\r\n\r\n5,000",
            "Q1, 2002 - February - Revenue":"10,000\r\n12,000\r\n75,000",
            "Q1, 2002 - February - Profit":"3,000\r\n1,000\r\n32,000",
            "Q1, 2002 - March - Revenue":"7,000\r\n6,000\r\n135,000",
            "Q1, 2002 - March - Profit":"2,000\r\n1,000\r\n66,000"
        },
        {
            region:"Eastern U.S.\r\n\r\n",
            product:"Pens\r\nChairs\r\nMonitors",
            "Q1, 2002 - January - Revenue":"22,000\r\n40,000\r\n105,000",
            "Q1, 2002 - January - Profit":"4,000\r\n\r\n25,000",
            "Q1, 2002 - February - Revenue":"31,000\r\n35,000\r\n164,000",
            "Q1, 2002 - February - Profit":"8,000\r\n4,000\r\n88,000",
            "Q1, 2002 - March - Revenue":"44,000\r\n15,000\r\n190,000",
            "Q1, 2002 - March - Profit":"20,000\r\n2,000\r\n115,000"
        }
    ]
    === 2014-04-30 16:57:05,184 [ec-6] INFO  ProxyHttpServletResponse - content-disposition set to: attachment; fileName=export.xls - unwrapping response output stream (CompressionFilter)
    === 2014-04-30 16:57:05,185 [ec-6] INFO  BuiltinRPC - Generating and streaming xls file...
    === 2014-04-30 16:57:05,187 [ec-6] DEBUG RPCDMI - rpc returned data

    #2
    We're getting a works-for-me result with the stock SDK (unsurprisingly). Can you confirm?

    Things to investigate:

    1. different version of POI

    2. some kind of filter servlet or authentication system interfering with normal behavior by discarding results

    3. some browser plugin, network proxy or similar interfering with normal operation - try other browsers / machines / networks

    Comment


      #3
      I got the same results (blank excel files). Here are my comments that I have tried regarding your numbered points:

      1. I used the poi in the snapshot
      webapps/Marks/WEB-INF/lib/poi-3.9-20121203.jar webapps/Marks/WEB-INF/lib/poi-ooxml-3.9-20121203.jar webapps/Marks/WEB-INF/lib/poi-ooxml-schemas-3.9-20121203.jar

      Then I went to the apache site and got the 3.10 version
      webapps/Marks/WEB-INF/lib/poi-3.10-FINAL-20140208.jar webapps/Marks/WEB-INF/lib/poi-ooxml-3.10-FINAL-20140208.jar webapps/Marks/WEB-INF/lib/poi-ooxml-schemas-3.10-FINAL-20140208.jar

      2. I removed spring authentication, so there's no authentication in place. For the attempts.

      3. I've tried: Firefox, Chrome and Safari with tomcat apache:

      (V1): ubuntu 3.11 tomcat 6.0.37
      (V2): mac os x 10.9.2. tomcat 7.0.27


      IN SUMMARY: I removed Spring authentication. I have used Firefox, Chrome and Safari with the following combinations:

      POI 3.9 and V1
      POI 3.9 and V2
      POI 3.10 and V1
      POI 3.10 and V2
      Last edited by michaeljseo; 2 May 2014, 06:26. Reason: explicitly spelled out my results.

      Comment


        #4
        Something unusual is going on in your environment.

        Can you try just deploying the pre-built Showcase .war and verify that works for you.

        If it doesn't, it's time to look closely at the client-side for problems - as previously mentioned, you might want to try different client machines and or networks.

        It would also be good to confirm that you are able to see Excel files downloaded from the public Showcase (not this particular sample, which isn't shown in the public 4.1 Showcase - just any other sample that produces an Excel file).

        Comment


          #5
          Pre-built Showcase:

          I tried the pre-built Showcase, but when I click on the Basic CubeGrid example, it does not start up. Nothing happens. When I click on the graph examples, they do start up. The PDF Export example worked.

          BTW, I used both the mac and linux version of tomcat/apache. One thing to note though, analytics.jar is not in WEB-INF/lib. Is the pre-built showcase suppose to be fully functional?

          Public 4.1 Showcase:

          The Excel Export example works. I was able to download a Results.xlsx file and open it with Excel.
          Last edited by michaeljseo; 2 May 2014, 14:00. Reason: forgot to add platforms used for testing.

          Comment


            #6
            Analytics is separately licensed and is a separate download. If you download Enterprise Edition and do not install Analytics, it would be expected that the Cube examples will display a message indicating that Analytics has not been loaded, and will not show a cube.

            Comment


              #7
              BTW, the Basic CubeGrid example didn't even respond. There were no complaints about missing Analytics.

              How would I install Analytics?

              I tried by copying my analytics.jar into WEB-INF/lib and restarted tomcat.

              Comment


                #8
                We'll re-verify that the expected error message appears when you attempt to run samples without the necessary required modules.

                Instructions for installing Analytics are here.

                Comment


                  #9
                  Here's what I did to enable analytics to the showcase example. I still do not get any response from the Cube Grid examples. Perhaps I missed something?

                  In the webapps/showcase directory of my tomcat server, I added analytics to:

                  ./WEB-INF/classes/com/smartgwt/sample/showcase/Showcase.gwt.xml

                  Code:
                  <?xml version="1.0" encoding="UTF-8"?>
                  <module rename-to="showcase">
                      <inherits name="com.google.gwt.user.User"/>
                      <inherits name="com.smartgwtee.SmartGwtEENoScript"/>
                      <inherits name="com.smartgwt.Analytics"/>
                      <inherits name="com.smartgwt.Drawing"/>
                      <inherits name="com.smartgwt.Charts"/>
                      <inherits name="com.smartgwtee.tools.Tools"/>
                      <inherits name="com.smartclient.theme.enterprise.EnterpriseResources"/>
                      <inherits name="com.google.gwt.i18n.I18N"/>
                  
                      <entry-point class='com.smartgwt.sample.showcase.client.Showcase'/>
                  
                      <!-- load the $systemSchema DataSources here after all modules -->
                      <script src="../sc/DataSourceLoader?dataSource=$systemSchema"></script>
                  </module>
                  Then I copied the analytics.jar into WEB-INF/lib.

                  Restarted tomcat and I still get no response from the Cube Grid examples

                  Comment


                    #10
                    We were able to reproduce the issue where the warning about the Analytics Module not being installed wasn't displayed, but once that was fixed, and the Analytics Module was installed, there was no further issue observed. The CubeGrid samples worked as expected.

                    The fix for the first issue should be in today's build of SGWT Enterprise 5.0d.

                    Comment


                      #11
                      Isomorphic,

                      As in my last post, I modified Showcase.gwt.xml identically. Then I copied all of the JARs from my Pre-release Enterprise Edition into the WEB-INF/lib directory. Created a war file from these procedures. After deploying on two tomcat platforms (V1 and V2), I get the same results on Firefox, Safari and Chrome.

                      I made sure that I cleared the caches, however, I do see the message on the tab, which did not appear in the earlier snapshot of the pre-release. So I'm confident there's no caching issues:

                      Code:
                      This example is disabled because it requires the optional Analytics module.
                      
                      Click here to see this example on SmartClient.com.
                      Please confirm that my procedure was correct for enabling the Analytics module.

                      Comment


                        #12
                        Please act on this advice, we've reiterated it twice already with no response:

                        If it doesn't, it's time to look closely at the client-side for problems - as previously mentioned, you might want to try different client machines and or networks.
                        At this point you're claiming the exact same server-side bytes just work differently for you, so we really need you to investigate the above as the actual cause.

                        Comment


                          #13
                          Ok Isomorphic.

                          I have now used Windows7 IE9 and get the same response.

                          I actually did not claim to run the exact same server-side bytes. I ran the previous snapshot that did not complain about the Analytics not being installed. Then I ran the later snapshot that fixed that. So I just reported that the latest snapshot now complains about Analytics not being installed.

                          The later snapshot with Analytics enabled complains that Analytics is not installed for Mac and Windows7. I get the same response no matter what network or machine or browser that I use.

                          Comment


                            #14
                            Can you elaborate on "get the same response"? From what? Your other installation that isn't based on the Showcase?

                            As far as Analytics not appearing enabled once installed, we are not reproducing this problem. Once you added analytics.jar and added the .gwt.xml settings, did you run a GWT compile?

                            Comment


                              #15
                              Same response means, no matter what combination of browser, machine or network, I get the same response as before.

                              HOWEVER, thank you for finally answering my question about the procedure I used for enabling Analytics by mentioning that I have to do a GWT compile. As you have asked me a couple times, I have asked you to comment on my procedure a couple times.

                              Comment

                              Working...
                              X