Home Forums WinForms controls Xceed Grid for WinForms Export to excel with number formatting

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15893 |

    I am currently trying to use your export functionality to create an excel file containing decimal and date data.
    I would like it to maintain the fixed number of decimal places and also display the date with my desired formatting.
    Is it possible to set the number (or date) format while exporting?

    The equivalent style I would like to produce would be along the lines of this:
    <Style ss:ID=”s69″>
    <Alignment ss:Horizontal=”Left” ss:Vertical=”Top”/>
    <Borders/>
    <Font ss:FontName=”Arial” ss:Size=”8″ ss:Color=”Black”/>
    <Interior ss:Color=”White” ss:Pattern=”Solid”/>
    <NumberFormat ss:Format=”0.0000″/>
    <Protection/>
    </Style>

    <Cell ss:StyleID=”s69″><Data ss:Type=”Number”>1.4</Data></Cell>

    But what gets produced by your export is this:
    <Style ss:ID=”xs3″>
    <Alignment ss:Horizontal=”Left” ss:Vertical=”Top” />
    <Font ss:FontName=”Arial” ss:Size=”8″ ss:Color=”Black” />
    <Interior ss:Color=”White” ss:Pattern=”Solid” />
    </Style>

    <ss:Cell ss:StyleID=”xs3″>
    <ss:Data ss:Type=”Number”>1.4000000000</ss:Data>
    </ss:Cell>

    Imported from legacy forums. Posted by Justin (had 3060 views)

    Xceed Support
    Member
    Post count: 5658

    It is not possible to specify the NumberFormat (even using the ExcelStyle). We added this as a feature request. However, we cannot give a time frame as of when (or if) this feature will be added.

    As a workaround, you would need to set the FormatSpecifier of the column to 0.000 and set the exportation mode to “Display Text”.

    Imported from legacy forums. Posted by CharlesB (had 382 views)

    User (Old forums)
    Member
    Post count: 23064

    I would say this feature is of grate value for most. If your client base is not that strong on computers the simple task of converting to numbers after you export to excel is rather …… well try doing it few times and you get the point 🙂

    Imported from legacy forums. Posted by Goggi (had 607 views)

    User (Old forums)
    Member
    Post count: 23064

    I meant to say try to explain it to the user few times 🙂

    Imported from legacy forums. Posted by Goggi (had 4250 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.