Announcement

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

    SmartClient v13.0 Listgrid Export

    Good day,
    I have updated from SmartClient 10 power edition to SmartClient_v130p_2022-10-26_PowerEdition and now exporting a list grid is not working. Below is the code for the list grid, the button used for the export and the exception that is thrown on the server. I have found that when I reduce the number of columns that list grid has and don't have to scroll to the side, then the export works. But if there are columns are not visible without scrolling, then an excel document is downloaded but it only contains the list grid headers of the visible columns, the non visible columns(the ones you cannot see without scrolling to the side) and the data(rows) are not present. Can someone please tell me what am doing wrong. I am using tomcat 8

    ListGrid
    isc.ListGrid.create({
    ID: "ManageMembersLgd",
    showHeaderContextMenu: false,
    dataSource: "datasource",
    validateByCell: true,
    saveOnEnter: true,
    showRowNumbers: true,
    selectionType: "multiple",
    alternateRecordStyles: true,
    showFilterEditor: true,
    filterOnKeypress: true,
    height: "100%",
    width: "100%",
    saveLocally: true,
    fields: [
    {
    name: "Colum_field",
    title: "Colum_field",
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 130,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 130,
    align: "left",
    showHover: true

    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 200,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 125,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 100,
    showHover: true,
    valueField: "Colum_field",
    optionDataSource: "data",
    _constructor: "SelectItem",
    filterEditorProperties:{
    value:"Active", operator: "equals"
    }
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 100,
    showHover: true,
    valueField: "Colum_field",
    optionDataSource: "data",
    _constructor: "SelectItem"
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 100,
    type: "float",
    defaultValue: 0.00,
    roundToPrecision: 2,
    decimalPad: 2,

    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 60,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 130,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    type: "link",
    linkURLPrefix: "mailto:",
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 120,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 110,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    type: "link",
    linkURLPrefix: "mailto:",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 120,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 100,
    align: "left",
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "",
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "title"
    width: 100,
    showHover: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    },
    {
    name: "Colum_field",
    title: "Colum_field",
    width: 165,
    align: "left",
    showHover: true,
    visible: true
    }
    ],
    sortFieldNum: 2,
    wrapCells: true,
    autoFetchData:true,
    enforceVClipping: true
    });

    Export Button
    isc.IButton.create({ ID: "btnManageMembersExport", autoDraw: false, height: 35, width: 220, title: "Export", click: function () { var exportAs = "ooxml"; ManageMembersLgd.exportData({ exportAs: exportAs, exportDisplay: "download" }); } });


    Exception
    java.lang.NullPointerException
    at com.isomorphic.rpc.ExcelDataExport.outputHeaders(ExcelDataExport.java:1121)
    at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:498)
    at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:664)
    at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:463)
    at com.isomorphic.rpc.RPCManager.doExport(RPCManager.java:2125)
    at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1028)
    at com.isomorphic.rpc.RPCManager.send(RPCManager.java:810)
    at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:183)
    at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:148)
    at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
    at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:178)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at za.co.adminonline.servlet.SecurityCheck.doFilter(SecurityCheck.java:115)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:250)
    at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:91)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

    #2
    Hello, this grid definition has many fields named the same thing, which is not allowed (in any version) and would break many, many things, not just export.

    Perhaps this was an accidentally done as you were trying to prepare test code? If so, let us know if there is valid test code that can reproduce this error.

    Note that export definitely works in general in the circumstances you describe. You can see this working properly in many, many Showcase examples.

    Comment


      #3
      Hi, I changed the names of the fields just to keep the names private, they are all unique on my system but will not export. can you pint me to the showcase examples

      Comment


        #4
        You can search for “export” or simply take any example and use the ability to add code to add an export button as shown in your example code above.

        Please let us know if you find a way to reproduce h problem.

        Comment


          #5
          I do not think am not doing a good enough job of explaining my problem. The export to excel functionality does not work when I have lots of columns in the list grid. The exception that is thrown is an Isomorphic one, please see the stack trace below.

          === 2022-11-07 12:24:26,127 [c-20] INFO DSResponse - DSResponse: List with 12 items
          === 2022-11-07 12:24:26,127 [c-20] INFO DSResponse - DSResponse: List with 12 items
          === 2022-11-07 12:24:26,171 [c-20] DEBUG ExcelDataExport - Export streaming mode: true
          java.lang.NullPointerException
          at com.isomorphic.rpc.ExcelDataExport.outputHeaders(ExcelDataExport.java:1121)
          at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:498)
          at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:664)
          at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:463)
          at com.isomorphic.rpc.RPCManager.doExport(RPCManager.java:2125)
          at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1028)
          at com.isomorphic.rpc.RPCManager.send(RPCManager.java:810)
          at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:183)
          at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:148)
          at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
          at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
          at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:178)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at za.co.adminonline.servlet.SecurityCheck.doFilter(SecurityCheck.java:115)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:250)
          at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:91)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
          at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
          at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1110)
          at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
          at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:785)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1425)
          at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:748)

          You mentioned that I should "search for 'export' or simply take any example and use the ability to add code to add an export button" which is what I did and it is not working. I thought by providing the List grid, the button that creates export excel and the stack trace you would be able to inform me of what I was doing wrong. Could you please tell me what other information you would need in order to make my situation much clearer.

          Comment


            #6
            We can't reproduce the problem, so it's hard to say what's causing it. That's why we directed you to the Showcase, to see if you could figure out a how to reproduce it.

            As far as guesses, it's likely to be something wrong in your environment, such as mixing jars from two different versions, or some kind of invalid override of a servlet. The reason this is likely is that you're showing a very basic capability being broken in a simple usage. If there were actually a framework issue like this, we would have seen several reports by now.

            So again, please try to see if you can make it reproducible for anyone else, or perhaps review the installation instructions and make sure you didn't skip anything.

            Comment

            Working...
            X