Announcement

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

    CSV Export not using correct titles in SmartGWT 5.0

    When exporting to a CSV file from a ListGrid in SmartGWT 5.0, the column field names are being used instead of the field titles.

    It can be reproduced using this sample:
    http://www.smartclient.com/smartgwtee/showcase/#custom_export

    (Version: 5.0p Built Thu May 07 02:45:00 GMT-400 2015 at the time I tested)

    When performing the export, the titles in the CSV are as follows:
    countryName,capital,continent,independence,population,gdppercapita


    If the same sample is run using 4.1p (built Fri Jun 05 01:36:00 GMT-400 2015) when performing the export, the titles in the CSV are as follows:
    Country,Capital,Continent,Nationhood,Population,gdppercapita

    #2
    See the Export Formatting overview for which export types default to using names vs titles, and how to control this.

    Comment


      #3
      The behaviour changed between versions: are you saying this was intentional?

      Comment


        #4
        reading the documentation provided, it appears to only be talking about displaying field values, not field titles. Am I missing something here?

        Comment


          #5
          Sorry, we pointed you at the wrong article (though it is related). The exportPropertyIdentifier property is what we meant to point you at.

          To answer your question, yes, this is an intentional change. Starting with 5.0, we took the view that exports fall into two general categories: data for viewing directly by end users, and data for import into some downstream system. We export data in the manner most appropriate for the export category. With exports for users, we export friendly titles and nicely-formatted data values; with exports for downstream systems we export field names and raw, unformatted values.

          As the above-linked doc explains, we place a server-driven CSV export in the "downstream system" category. Of course, not every server-driven CSV export will be intended for a downstream system, but that's what we consider to be most likely (CSV files are, of course, very commonly imported into Excel by end users, but since we support direct Excel export, we assume you would use that if the intended target was Excel). But you are not tied to the categories we chose: we provide the "exportPropertyIdentifier" and exportRawValues settings so you can configure it.

          Comment


            #6
            That makes sense. Thanks!

            Comment

            Working...
            X