Announcement

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

  • DataSourceField.exportTitle not working for DataSource.exportClientData

    SmartClient Version: v11.1p_2018-05-02/Enterprise Development Only (built 2018-05-02)

    Hello, please try this test case:

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:800, height:250, top:75, left: 10,
        alternateRecordStyles:true,
        dataSource: worldDSExport,
        autoFetchData: true,
        fields:[
            {name:"countryName", title:"Country"},
            {name:"capital", title:"Capital"},
            {name:"continent", title:"Continent"},
            {name:"independence", type: "date", title:"Nationhood", format:"ddd MMMM dd yyyy", width:150},
            {name:"population", type: "number", title:"Population", format:",0"},
            {name:"gdp", title:"GDP", type: "float", format: ",0.00"}    ],
        showFilterEditor: true
    });
    
    
    
    isc.Button.create({
       ID: "exportButton",
       title: "Export",
       left: 320, top: 10,
       click: function () {
               worldDSExport.exportClientData([countryList.getOriginalData().get(0)], { exportAs: 'xls'})
       }
    });
    In the countryName field of the dataSource I've added an exportTitle attribute:

    Code:
    <DataSource
        ID="worldDSExport"
        tableName="worldDS"
        serverType="sql"
        recordName="country"
        testFileName="/examples/shared/ds/test_data/world.data.xml"
    >
        <fields>
            <field name="pk"            type="integer"    hidden="true"            primaryKey="true" />
            <field name="countryCode"   type="text"       title="Code"             required="true"   />
            <field name="countryName"   type="text"       title="Country"  exportTitle="foo"        required="true"   />
            <field name="capital"       type="text"       title="Capital"          />
            <field name="government"    type="text"       title="Government"       length="500"      />
            <field name="continent"     type="text"       title="Continent"        >
                <valueMap>
                    <value>Europe</value>
                    <value>Asia</value>
                    <value>North America</value>
                    <value>Australia/Oceania</value>
                    <value>South America</value>
                    <value>Africa</value>
                </valueMap>
            </field>
            <field name="independence"  type="date"       title="Nationhood"          />
            <field name="area"          type="float"      title="Area (sq km)" />
            <field name="population"    type="integer"    title="Population"          />
            <field name="gdp"           type="float"      title="GDP ($M)"            />
            <field name="member_g8"     type="boolean"    title="G8"                  />
        </fields>
    
        <operationBindings>
            <operationBinding operationType="fetch" operationId="customJSONExport">
                <exportResults>true</exportResults>
                <exportAs>json</exportAs>
                <exportFilename>Results.txt</exportFilename>
                <lineBreakStyle>dos</lineBreakStyle>
            </operationBinding>
        </operationBindings>
    
    </DataSource>
    You'll see that the exportTitle is not used in the excel file.

  • #2
    Hi all,

    this might be related to this one.

    Best regards
    Blama

    Comment


    • #3
      thanks Blama, actually it's fixed using latest build:
      SmartClient Version: v11.1p_2018-06-12/Enterprise Development Only (built 2018-06-12)

      Comment

      Working...
      X