Uderc programming article aggregator sites

Export Custom List into Excel through custom Ribbon

Hi i have a requirement, in that i need to export custom list into EXCEL through custom Ribbon. For Example in my list, i have Col1, Col2, Col3. Col3 has multiple values (allow mutiple values) and when export this into excel all values in Col3 should
come as new rows and rest of the column values should duplicate. please helpout from this requirement.
List View
Col1   Col2      Col3
v1        v2    v31,v32,v33
Excel View
Col1  Col2  Col3
v1      v2      v31
v1      v2      v32
v1      v2      v33
The best answer: Hello Nihath,
As per your description, you have to read each and every items in list with column value then only you can generate excel. There is direct way to export datatable to excel but in your case you will also need to iterate Col3 value to create new row in excel.
I would suggest to use CAML query to get all items then check Col3 value. If there are multiple value then add them as new datatable row and finally export full datatable to excel.
Here is link for CAML:
Export datatable to excel:
Finally add this feature in ribbon:
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help