Announcement

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

    12.0p Export with ListGrid.exportData() applies wrong field width

    Hi Isomorphic,

    please see this modified sample (v12.0p_2020-04-15), where the ListGrid field width don't match the export.

    Code:
    isc.ListGrid.create({
        ID: "countryList", exportFieldWidths: true,
        width:600, height:250, alternateRecordStyles:true,
        dataSource: worldDSExport,
        autoFetchData: true,
        fields:[
            {name:"countryName", title:"Country", width: 101},
            {name:"capital", title:"Capital", width: 102},
            {name:"continent", title:"Continent", width: 103},
            {name:"independence", title:"Nationhood", width: 104},
            {name:"population", title:"Population", width: 105}
        ],
        showFilterEditor: true
    });
    
    isc.Button.create({
       ID: "exportButton",
       title: "Export",
       top: 260,
       click: function () {
               countryList.exportData({ exportAs: "ooxml",
                                        exportFields: ["gdp", "countryName", "capital", "continent"]
               });
       }
    });

    If you click export, you'll see this request in the Developer Console's RPCRequest tab.
    Please see the bold parts.
    There are 4 exportFields (expected) and 5 exportFieldPixelWidths (unexpected).

    I'd expect something like for exportFieldTitles, where there are values mapped:
    Code:
            "exportFieldPixelWidths":{
                "countryName": 101, 
                "capital": 102, 
                "continent": 103
            },
    Now the server would use the given width for these three fields and a default width (perhaps depending on .ds.xml length, if it's a text field) for the remaining field "gdp", where the ListGrid can't send data.

    Code:
    {
        "actionURL":"https://www-demos.smartclient.com/smartclient-12.0/isomorphic/IDACall", 
        "showPrompt":false, 
        "transport":"hiddenFrame", 
        "promptStyle":"cursor", 
        "bypassCache":true, 
        "data":{
            "criteria":null, 
            "operationConfig":{
                "dataSource":"worldDSExport", 
                "repo":null, 
                "operationType":"fetch", 
                "textMatchStyle":"substring"
            }, 
            "exportResults":true, 
            "exportAs":"ooxml", 
            "exportDelimiter":",", 
            "exportTitleSeparatorChar":"", 
            "exportFilename":"Results.xlsx", 
            "exportPath":null, 
            "exportDisplay":"download", 
            "lineBreakStyle":"default", 
            "exportFields":[
    [B]"gdp", [/B]
                "countryName", 
                "capital", 
                "continent"
            ], 
            "exportHeader":null, 
            "exportHeaderless":null, 
            "exportFooter":null, 
            "exportFieldTitles":{
    [B]            "gdp":"GDP ($M)", 
                "countryName":"Country", 
                "capital":"Capital", 
                "continent":"Continent"[/B]
            }, 
            "exportDatesAsFormattedString":null, 
            "exportNumbersAsFormattedString":null, 
            "exportRawValues":true, 
            "exportCurrencySymbol":"$", 
            "exportHeaderSpans":null, 
            "exportOtherFields":{
                "gdp":"GDP ($M)", 
                "countryName":"Country", 
                "capital":"Capital", 
                "continent":"Continent"
            }, 
            "exportFieldPixelWidths":[
    [B]            101, 
                102, 
                103, 
                104, 
                105[/B]
            ], 
            "exportWidthScale":0.12, 
            "exportWrapHeaderTitles":null, 
            "exportPropertyIdentifier":"name", 
            "appID":"builtinApplication", 
            "operation":"worldDSExport_fetch", 
            "oldValues":null
        }
    }
    Best regards
    Blama

    #2
    This will be fixed back to SC 12.0p in the nighlty builds dated 2020-04-24. We've added a new property, ListGrid.exportHiddenFieldWidth (default 100), to allow a width to be specified for hidden fields.

    Comment


      #3
      Hi Isomorphic,

      this is fixed for me in v12.0p_2020-04-25. ListGrid.exportHiddenFieldWidth is also doing what you say.

      Thank you & Best regards
      Blama

      Comment

      Working...
      X