Announcement

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

    ListGrid Excel Export - Treat Numbers as text

    Hello,

    I am using SGWT's export functionality to export the grid data to XLS. Works
    fine except for a 15-digit code field which comes out in exponential format.
    The 15-digit code is stored & treated as text (since it can have leading 0's)
    and works fine in the grid.

    When I export, the spreadsheet has the value as 1.00946E+14.

    How can I have SGWT set the XLS column property as text so that Excel
    doesn't convert it into scientific notation?

    The same problem also happens when I export a Zip Code field. The leading
    zeroes are missing from the spreadsheet.

    I am using SGWT Power 2.3.

    Thanks,
    Mouli

    #2
    What kind of export (exportData() or exportClientData())?

    Can you show the DataSource and grid definition?

    Comment


      #3
      Please also show the request data you see in the RPC tab of the Developer Console.

      Comment


        #4
        Actually, we see a shortcut here. If you're exporting numbers with leading zeroes, you presumably want to keep them, and don't want the text to be converted to a number even though it is numeric. We've changed the exporter to honor that special case. Please check it with tomorrow's nightly build.

        Comment


          #5
          Isomorphic,

          Thanks a lot for your excellent support. I verified with the nightly build and
          numbers with leading zeros are exported as text.

          However, the other large numbered texts are interpreted as numbers by Excel,
          resulting in them being converted to scientific notation. The resultant output
          in Excel is as below:

          Code
          000137000001045
          008037807060700
          1.24531E+14 <-- should be 124531001007500
          ...
          ...

          Any idea as to how this can be fixed?

          Thanks,
          Mouli

          Comment


            #6
            You've got 3 questions above we're still waiting for you to answer.

            Comment


              #7
              Hi,

              I am using SmartClient Power Edition version 8.3 and I've come accross exactly the same issue as described in this post.

              Basically, when I am exporting to Excel my ListGrid, I am getting some of the content displayed on scientific notation when the field holds a long number (1234567891234570 is displayed as 1.23457E+15).

              Does SmartClient provide any option to make excel treat a column as Text or a workaround on this issue?

              Many thanks,
              Josué

              Comment

              Working...
              X