• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 871
  • Last Modified:

I need to export a DataReader to Excel(.xls v2003 or later) file with out using the Office COM object

I have a project that I need to export a DataReader out to an excel format (.xls v2003 or later). I can not use the Microsoft Office COM object. The office here uses OpenOffice so therefore the COM libary is out. CSV will not meet the need in this case as the management wants to format columns.
0
mdbarker813
Asked:
mdbarker813
  • 3
  • 2
  • 2
1 Solution
 
SriVaddadiCommented:
Use the oledbdata provider and connect to excel as it is a database and you could run your queries against it. IOW even the insert queries.
0
 
mdbarker813Author Commented:
Excel is not on a single machine in the building. This has to be done from scratch. This is an export to an .xls file.
0
 
SriVaddadiCommented:
heck this out.

http://social.msdn.microsoft.com/Forums/fi-FI/adodotnetdataproviders/thread/d4302820-4a83-4bae-
9995-91c88abaf87b

You need Microsoft.Jet.Oledb data provider and you could write to an excel (.xls) file as you would store data to a database table.

After going through the thread, let me know if you need help.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
SriVaddadiCommented:
check this out.

http://social.msdn.microsoft.com/Forums/fi-FI/adodotnetdataproviders/thread/d4302820-4a83-4bae-
9995-91c88abaf87b

You need Microsoft.Jet.Oledb data provider and you could write to an excel (.xls) file as you would store data to a database table.

After going through the thread, let me know if you need help.
0
 
tikusbalapCommented:
Try third party component like Aspose.Cell for .NET

http://www.aspose.com/categories/.net-components/aspose.cells-for-.net/default.aspx

It is good to export whatever you need.
0
 
mdbarker813Author Commented:
Sounds like a good product... However, they are cheap asses... hence the OpenOffice... so they sure are not going to buy a $800 third party component... Thx
0
 
tikusbalapCommented:
A simple way is convert rows to comma separated value (csv). Any Excel version can open csv format.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now