0

I am exporting CSV file in Reactjs where I need to create dropdown in generated CSV file

I tried excel.js and shell.js as well as csvlink download

<CSVLink data={data}>Download me</CSVLink>;

it showing normal csv with key value pair

eisbehr
  • 12,243
  • 7
  • 38
  • 63
shweta
  • 1
  • 1

1 Answers1

0

CSV file doesn't allow to use anything like dropdown. If you want a dropdown you need to use spreadsheet format.

Spreadsheets allows to have data validation:

Dropdown in google sheet

Dropdown in Excel

Here is code sample from Python: How to add a dropdown list to google sheet using Google Sheets API python

Maciej Trojniarz
  • 702
  • 4
  • 14
  • is it possible in spredsheet to add dropdown – shweta Sep 12 '19 at 08:03
  • @shweta spreadsheets allows to have data validation. I'm not sure if you can code it that way with any library (possible can) but: https://support.google.com/docs/answer/186103?co=GENIE.Platform%3DDesktop&hl=en https://www.techrepublic.com/blog/microsoft-office/how-to-add-a-drop-down-list-to-an-excel-cell/ – Maciej Trojniarz Sep 18 '19 at 08:11