vb.net - DataGrid export to excel -


i have datagrid control fills data set.

i don't show fields of data set in datagrid control.

i want create excel file datagrid.

how solution?

(windows form , vb net 1.1)

try link

or

try this

imports excel = microsoft.office.interop.excel  dim excel new microsoft.office.interop.excel.applicationclass dim wbook microsoft.office.interop.excel.workbook dim wsheet microsoft.office.interop.excel.worksheet   wbook = excel.workbooks.add(system.reflection.missing.value) wsheet = wbook.sheets("sheet1")    wbook .sheets("sheet1").select() .sheets(1).name = "nameyoursheet" end   = 0 datagrid1.rowcount - 1 j = 0 datagrid1.columncount - 1 wsheet.cells(i + 1, j + 1).value = datagrid1.rows(i).cells(j).value.tosring next j next  wsheet.columns.autofit() 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -