Datatables export Excel

0 votes

I'm exporting the datatables in csv. And when I open the file with excel, I've got problem with big numbers (around 20 digits). I also have problem with the special characters. I guess it's a formatting problem. But I don't know How to correct the problem.

The code in my Js file:

dom: 'Bfrtip',
    buttons: [
        {
            extend: 'csv',
            text: 'csv',
            fieldSeparator: ';' // with ';' we can export the file in csv and each column is in one column. Without ';' everything is in one column
        },
        'pdf',
        'print'
    ]

An image of the problem: enter image description here

Thanks for your help.

Jun 8, 2022 in JQuery by Edureka
• 13,640 points
507 views

1 answer to this question.

0 votes

Follow the following steps :

  1. Add Interop References. First we need to add a reference for Microsoft.office.interop.Excel as in the following:
  2. Create a DataTable dynamically.
  3. Class file for generating Excel. ...
  4. Creation of Excel objects. ...
  5. Initialization of Excel objects. ...
  6. Writing to Excel file. ...
  7. Working with range and formatting Excel cells. ...
  8. Coloring cells.
answered Jun 9, 2022 by gaurav
• 22,940 points

Related Questions In JQuery

0 votes
0 answers

Datatables: Cannot read property 'mData' of undefined

I am having trouble with data tables, ...READ MORE

May 12, 2022 in JQuery by Kichu
• 19,040 points
2,063 views
0 votes
1 answer

How to turn off Auto Refresh on "Stock Price" Data Type in Excel

How do you stop Excel from automatically ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 22,940 points
77 views
0 votes
1 answer

How to upload excel file to php server from <input type="file">

You first need to upload the file ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 22,940 points
2,822 views
0 votes
1 answer

Calculate the number of days between a cell and today in excel?

Excel Formula to Calculate Number of Days ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 22,940 points
58 views
0 votes
1 answer
0 votes
1 answer

datatable remove column on export to pdf and excel

When we are using jquery datatable for ...READ MORE

answered Feb 17, 2022 in Others by gaurav
• 22,940 points
2,173 views
0 votes
0 answers

Datatables export Excel

I'm exporting the datatables in csv. And ...READ MORE

Apr 7, 2022 in Database by Edureka
• 13,640 points
538 views
0 votes
1 answer

TypeError: $(...).DataTable is not a function

This happened because the jQuery DataTables library ...READ MORE

answered Apr 30, 2022 in Git & GitHub by narikkadan
• 51,600 points
3,416 views
0 votes
1 answer

Export DataTable to Excel File

Add Interop References. First we need to ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 22,940 points
206 views
0 votes
1 answer

Disable Sorting in excel

Go to the Home ribbon, click the ...READ MORE

answered Jun 9, 2022 in JQuery by gaurav
• 22,940 points
58 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP