0

I have a program that currently outputs Excel via SpreadsheetML files. I build these using streams. This is very space inefficient for Excel; the files can be 5 to 6 times as large as other Excel binary formats.

I would like to output a binary excel format such as .xls or .xlsx, but I don't want to have the installation of the program depend on Office. Some users might have it installed, some might not. How can I handle this gracefully? Is it possible to not have an assembly as a dependency but based on the user enabling binary output still use the assembly?

Edit:

In reviewing some old questions, I realized I should have been asking how to check if the Office PIA are on the system, use them if available, but gracefully handle the case when the yare not and use SpreadsheetML.

Kara
  • 6,115
  • 16
  • 50
  • 57
mindless.panda
  • 4,014
  • 4
  • 35
  • 57

2 Answers2

1

If your base programming platform is Java you can use POI. If it's .NET you can use NPOI (a port of POI, actively under development).

Most of the features are supported by these libraries. You need not install Office, just include the corresponding libraries in your program.

rAm.

rAm
  • 1,086
  • 2
  • 16
  • 23
0

Do you have a specific requirement for a binary file vs. some other format that Excel will read nicely? Will the old trick of outputting an HTML table with .xls extension work for your application? Excel will render formatting properly and I think you can even embed formulas in the table cells and they will be rendered in Excel too...

Aerik
  • 2,307
  • 1
  • 27
  • 39
  • The question ask specifically about using a binary format to get a more compact file size. Whilst HTML representation may be more compact than the office Xml format, it is still text and will also have big floppy tags. – Tim Lloyd May 22 '10 at 15:42