Question Export datatable to excel file fastest way ?

tonifirnandes

Member
Joined
Mar 7, 2013
Messages
20
Programming Experience
1-3
Hello dear all the best programmer,

hopely you would like to solve my problem. here :
I've got a load of DataTables that I want to export into several Excel worksheets (in a new spreadsheet / Excel file). The "solution" that already exists in the code I have is two nested for loops, iterating over all the rows and columns, inserting data cell-by-cell. This isn't ideal as the process takes well over 10 minutes. There's a fair amount of data as the resulting spreadsheet is 8.5MB, but surely there must be a faster way?
i've get way by populate first in array all my data but it still lack way. is there any body know how to export directly from a table to be a table in excel file.


thanks.

best regards,


toni firnandes.
 
Hi dear all the best programmer,

especially for my friend Ian, thank you for your helping again. finally i've could to export data to excel from a table so i don't need datagridview again and my report become dynamic enough. cos i can make a query that can meet my need to the report and the query make table and from the table to the excel.

but dear,

i've problem again. when i user saveas method. when the file that i want to save already exist , there is dialog box pop up . the dialog or maybe message box say if the file already exist. if i chosse yes button there is no mater in my code , the program run normally and the file have been save to the file exist so the change already update to the excel file. but when i choose no or cancel button, the file breakdown there is an error message box pop up.

hopely you woule like to help me again to solve this, thanks.
 
Back
Top