Announcement

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

    Regression in 9.1p smartclient for export as excel

    we are using Version v9.1p_2014-04-10/PowerEdition Development Only (2014-04-10).

    I have a Grid with date columns. while exporting to excel, date column comes up with unexpected text.

    For Example, if the date is 4/12/2014 21:48, After exporting it comes like toU2411ort4AMt2012ti02012.


    Following is the code used to export the grid

    _gridObject.exportClientData({
    exportAs : "xls",
    exportDisplay : "download",
    exportFilename : EXPORT_FILENAME + ".xls"
    })

    Field configuration
    <field name="createDate" type="datetime" dateFormatter="toUSShortDatetime" title="System Date" defaultDisplay="true" labelCode="test.test" />



    This is not happening in older version

    #2
    It's not happening in the newer version either, as you can see in the samples.

    We'd suggest:

    1. check on your character encoding settings, as covered in the Internationalization overview in the docs

    2. see if it happens on more than one machine - could be a broken Excel installation or similar

    3. let us know the specific version and platform of Excel where it does happen

    4. make sure you are using the same version of POI and other dependent libraries as we list in the docs (Java Dependencies overview).

    Comment


      #3
      Can you pls let me know the document name and location.

      I searched through \smartclientSDK\docs but I am not able to find the section that you mentioned.

      My Environment: Windows 7 and Excel 2010.
      It is happening in all the machine with the same environment.

      Comment


        #4
        9.1 Regression

        I verified character encoding and POI dependency. It looks good as per your document. So stil i have a same issue.

        Here is the Testcase


        <!DOCTYPE html>

        <html>
        <head>

        <title></title>

        <style>
        .diagInfo {
        font-size: 14px;
        font-weight: bold;
        padding: 5px;
        }
        </style>

        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Core.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Foundation.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Containers.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Grids.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Forms.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_DataBinding.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Drawing.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_PluginBridges.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Charts.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/system/development/ISC_Tools.js"></script>
        <script type="text/javascript" SRC="http://localhost:8080/isomorphic/skins/EnterpriseBlue/load_skin.js"></script>

        <script type="text/javascript" >
        var isomorphicDir="http://an2605.pitnet.com:8080/isomorphic/";

        // set this to the correct JIRA ticket
        var JIRA_TICKET = "test-449";

        // test data
        var data = [
        {inspectorID:12345, region:"Northeast", inspections:0, observations:913,lastInspectionDate:new Date(2012, 8, 13), index:52.6 },
        {inspectorID:67890, region:"West", inspections:0, observations:2,lastInspectionDate:new Date(2013, 2,2), index:75.3 },
        {inspectorID:54321, region:"Northeast", inspections:0, observations:67,lastInspectionDate:new Date(2013,2,3), index:75.3 },
        {inspectorID:09876, region:"South", inspections:7, observations:0,lastInspectionDate:new Date(2012,8,31), index:52.6 }
        ];
        // datasource for the grid
        isc.DataSource.create({
        ID: "ds",
        fields: [
        {name:"inspectorID", title:"Inspector ID", type:"integer", showIf:"false" }, // hidden
        {name:"inspections", type:"integer", title:"Number of Inspections Total"},
        {name:"observations", title:"# Observations"},
        {name:"region", type:"text", title:"Region/Country"},
        {name:"lastInspectionDate", type:"date", title:"Last Inspection", dateFormatter:"toUSShortDatetime"}
        ],
        cacheData:data,
        clientOnly: true
        });

        // once page loads set some diagnostic information
        isc.Page.setEvent("load", function() {
        document.title = JIRA_TICKET + " (SmartClient version " + isc.versionNumber + ")";
        var html = [];
        html.push("Jira: " + JIRA_TICKET);
        html.push("SmartClient: " + isc.versionNumber);
        html.push("Browser: " + navigator.appCodeName + " " + navigator.appName + " " + navigator.appVersion);
        diagLabel.setContents( html.join("<br>"));
        });
        var exportXLS = function() {
        grid.exportClientData({
        exportAs : "xls",
        exportDisplay : "download",
        exportFilename : JIRA_TICKET + ".xls"
        })
        }

        var exportPDF = function() {
        var settings = { skinName : "EnterpriseBlue",
        pdfName : JIRA_TICKET
        };
        isc.RPCManager.exportContent(layout, settings);
        }
        </script>

        </head>

        <body>
        <script>

        // this laebl should not be removed, all test cases should have this
        var diagLabel = isc.Label.create({
        ID: "diagInfo",
        width: "100%",
        styleName: "diagInfo",
        autoFit: true
        });



        // basic grid
        var grid = isc.ListGrid.create({
        dataSource: ds,
        dataFetchMode : "local",
        autoFetchData: true,
        clientOnly: true,
        position: "relative",
        width : "100%",
        align : "center",
        autoFitData : "vertical",
        autoFitMaxHeight : 400,
        alternateRecordStyles : true,
        canAddFormulaFields : true,
        canAddSummaryFields : true,
        canGroupBy : true,
        canReorderFields : true,
        showGroupSummary : true,
        groupByMaxRecords : 5,
        useAdvancedFieldPicker: true,
        advancedFieldPickerThreshold: 5,
        autoDraw: false
        });

        // the main page layout - place all other components afetr diagLabel
        isc.VLayout.create({
        width:"100%",
        membersMargin: 20,
        members: [
        // this must remain here to output diagnostic information
        diagLabel,
        // add any other components here
        grid
        ]
        });

        </script>

        </body>

        </html>

        Comment


          #5
          9.1P Regression

          Any update on this ?

          It is High Priority issue for us as our customers can not see the dates in proper format. Also it is a regression in your latest build.

          Comment


            #6
            OK, we see the issue - it is happening because your dataSource specifies "toUSShortDatetime" and the export code is looking for "toUSShortDateTime" (note the capital "T" on "Time"). Actually, the value you are using is correct as documented, so this is a long-standing bug that was made more pronounced by the introduction of the new declarative formatting subsystem - previously, you wouldn't have been getting your dates exported in 'toUSShortDatetime' format, but they would have been exported in a generic readable format that is fairly similar, whereas now you get apparent gibberish.

            We have changed the export logic to accept either "Time" or "time" in the preset names, and this fix will be present in 9.1p nightly builds as of tomorrow, April 18. If you cannot move to the latest nightly for some reason, simply changing your "dateFormatter" setting to "toUSShortDateTime" should also do the trick.

            Comment

            Working...
            X