FlexGrid Truncate data

Posted by: manuel.diaz on 28 October 2021, 10:44 pm EST

  • Posted 28 October 2021, 10:44 pm EST - Updated 3 October 2022, 10:55 pm EST

    Im trying to truncate some columns data because its to big, i tried Autosizecols and try too .Cols.MaxSize

    Im saving a excel from flexgrid but i have Only 2 columns but in one column the data is lo large then he create another 3 columns, i want only see that 2 columns with the data truncate with the max possible characters

    See the image

  • Posted 29 October 2021, 3:44 am EST

    Hi Manuel,

    the easiest way should be to add a dummy column to your grid before saving to excel (and removing if afterwards), and write a single SPACE character to each cell. This column will also be exported to excel, and thus the col before will not spill over.

    Even Excel itself does not contain a format setting to clip texts at the end of the cell, so it is an excel limitation, and adding empty cells is the suggested workaround in the web.

    Hope this helps

    Wolfgang

  • Posted 1 November 2021, 2:59 am EST

    Hi Manuel,

    If you do not want the last column to overflow in excel then you can either use the workaround suggested by Wolfgang or you can use the C1Excel library to post-process the saved excel file and turn on WordWrapping for the cells. Please refer to the sample attached.

    Regards

    Avnish

    PS:

    Thank you! Wolfgang for the workaround suggested.

    FG_Overflow.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels