asp.net - Export gridview to csv -


i trying export gridview csv.

  • i adding actual record cell of excel not trying html excel.
  • i executing sp, taking record datatable.
  • looping through datatable, writing file using streamwriter.

but problem occur when column has long number, csv shows 890+32 this.

i don't want this, want actual number 89012345676898899998776766544333445556677.

how that? not using gridview.rendercontrol(htmltextwrtter).

try cast number string , add leading ' force excel see entry text, this:

'89012345676898899998776766544333445556677

otherwise excel see them numbers (which are, of course) , auto-format them in unwanted format.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -