This is a migrated thread and some comments may be shown as answers.

Excel export shows empty column for fields that have array of simple strings as values

3 Answers 846 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Noah
Top achievements
Rank 2
Iron
Iron
Iron
Noah asked on 25 Mar 2016, 04:08 PM

columns: [
  {field: 'EmptyExport', values: ['red', 'white', 'blue']},
  {field: 'GoodExport', values: [
    {text: 'red', value: 'red'},
    {text: 'white', value: 'white'},
    {text: 'blue', value: 'blue'}]
  }
]

If you use the excel export feature for a grid with the columns listed above, the 'EmptyExport' field values don't make it into the excel grid (it's just an empty column), but the GoodExport field values do.

This is with version 2016.1.322

3 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 28 Mar 2016, 07:41 AM

Hello Noah,

I am unable to reproduce the behavior on my end. Here is a small example that demonstrates the feature in action. There is no CDN for version 2016.1.322, but the behavior is the same there too.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Noah
Top achievements
Rank 2
Iron
Iron
Iron
answered on 28 Mar 2016, 01:42 PM

Exports Blank column

I don't know if that link will work, but if not, if you replace the grid definition in your dojo with the below, you will see the blank column when you export.

$("#grid").kendoGrid({
  toolbar: ["excel"],
  excel: {
    allPages: true
  },
  columns: [
    { field: "productName" },
    { field: "category", values: [
      "Beverages",
      "Food"
    ] }
  ],
  dataSource: [
    { productName: "Tea", category: "Beverages" },
    { productName: "Ham", category: "Food" }
  ]
});

0
Accepted
Dimiter Madjarov
Telerik team
answered on 28 Mar 2016, 01:54 PM

Hello Noah,

The current implementation is incorrect. As stated in the documentation each item in the columns.values array must have a text and value field. An array of strings is not supported in this case.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Noah
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Dimiter Madjarov
Telerik team
Noah
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or