Search code examples
angularkendo-uikendo-gridkendo-ui-angular2

Column Wrapping Excel Export in Kendo UI Grid


I have a Kendo UI Grid and i need to do some Column Wrapping(newsDescription column) when i export the items to excel.(In some columns i have lots of data and in exported excel expanded with that data.I need to shrink it.)

In my grid i have tried like below,

  <kendo-grid-excel [fileName]="fileName" [fetchData]="fullData">
                        <kendo-excelexport-column field="newsName" title="Name"></kendo-excelexport-column>
                        <kendo-excelexport-column field="newsCategory" title="Category"></kendo-excelexport-column>
                        <kendo-excelexport-column field="newsDescription" title="Description" [CellOptions] = {wrap:true}></kendo-excelexport-column>
                    </kendo-grid-excel>

Solution

  • Could you specify a width for the export column, so that the content gets wrapped according to the specified width?

    column component API

    <kendo-grid-excel [fileName]="fileName" [fetchData]="fullData">
        <kendo-excelexport-column field="newsName" title="Name"></kendo-excelexport-column>
        <kendo-excelexport-column field="newsCategory" title="Category"></kendo-excelexport-column>
        <kendo-excelexport-column field="newsDescription" title="Description" [width]="250" [CellOptions] = {wrap:true}></kendo-excelexport-column>
    </kendo-grid-excel>