We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Exporting To Excel from Grid data bound control

Thread ID:

Created:

Updated:

Platform:

Replies:

55207 Jan 24,2007 11:07 PM Jan 25,2007 07:26 AM Windows Forms 1
loading
Tags: XlsIO
Anna Srinivasan
Asked On January 24, 2007 11:07 PM

Hi,
Please find attached images for "Exporting To Excel from Grid data bound control".
I am using the following syncfusion method to export.
"sheet.ImportDataView(dtExport.DefaultView, true, 4,1, maxRows, -1, false);"
Please look at the comments column (String column) in the image, I am having this (05/08 2 5/8) value on comments column first row and my data table also contains the same value, but when I do export, it is coming like (05/08/2007) instead of (05/08 2 5/8).
Kindly give me the solution at the earliest.

Regards,
Anna



Images20.zip

Melba Winshia [Syncfusion]
Replied On January 25, 2007 07:26 AM

Hi Anna,

Could you please set "true" to the preserveTypes property of ImportDataView method so that the data type is also preserved along with it during importing into excel? Please refer the following code snippet that illustrates the above:

[C#]
//Import data to excel
sheet.ImportDataView(dataview,true,1,1,-1,-1,true);

Please refer the following sample which implements the above said feature:

GridToExcel.zip

Please take a look at the attached sample and let me know if you have any other queries.

Best Regards,
Melba


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;