hi,

I want to export data to Excel from Dataset and DataGrid and format the output excel file like "Auto Fit" for coulns, Bold headers and also control the Cells.

Please dont suggest using Interop Calls.
I understand that we can use the RenderControl to write to the htmltextwriter so may be someone can enhance on this.


I need the .NET equivalent.

Re: Help with Excel Export 80 80

HI,

I recommand spire.xls component, It's easy to use,
may useful to you.
http://www.e-iceblue.com

Re: Help with Excel Export 80 80

I have a limitation. i cannot use any thirdparty component. Any other idea?

Re: Help with Excel Export 80 80

hi,

I want to export data to Excel from Dataset and DataGrid and format the output excel file like "Auto Fit" for coulns, Bold headers and also control the Cells.

Please dont suggest using Interop Calls.
I understand that we can use the RenderControl to write to the htmltextwriter so may be someone can enhance on this.


I need the .NET equivalent.

you can export from datagridview to excel

For i = 0 To DataGridView1.RowCount - 2
For j = 0 To DataGridView1.ColumnCount - 1
xlWorkSheet.Cells(i + 1, j + 1) = _
DataGridView1(j, i).Value.ToString()
Next
Next


follow this :

http://vb.net-informations.com/excel-2007/vb.net_export_from_datagridview_to_excel.htm

Re: Help with Excel Export 80 80

As i wrote in my original post Please dont suggest using Interop Calls. Also Iam looking for formatting techniques.

you can export from datagridview to excel

For i = 0 To DataGridView1.RowCount - 2
For j = 0 To DataGridView1.ColumnCount - 1
xlWorkSheet.Cells(i + 1, j + 1) = _
DataGridView1(j, i).Value.ToString()
Next
Next


follow this :

http://vb.net-informations.com/excel-2007/vb.net_export_from_datagridview_to_excel.htm

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.