The February 2010 version is available

by clearoffice 28. February 2010 00:03

The February 2010 version is now available for download. The .NET version is 1.0.2010.220. You can download it here.

The only visible change is the "2010" in the splash window.

All other changes are internal

  • The charts have been improved.
  • Some files open much faster.
  • Filtering has been improved for large sets.

Enjoy

Tags: ,

December 2009 version available

by clearoffice 31. December 2009 20:05

Clear Office 1.0 December 2009 version is now available for download.

It includes some bug fixes, better charts and faster loading of some file.

Tags:

1.0

by clearoffice 2. December 2009 07:43

Version 1.0 is now available for download!

Clear Spreadsheet 1.0 is the first WPF based spreadsheet software. It is also free.

The Spreadsheet Framework offers a stable foundation for writing robust and flexible spreadsheet enabled applications.

Enjoy.

Tags:

Creating add-ins for Clear Office

by clearoffice 30. October 2009 07:19

The functions accessible from worksheet formulas are implemented as public static functions in special assemblies also called add-in.
Spreadsheet Clear Office comes with two add-ins:

  • The standard add-in (Office.Spreadsheet.StandardAddIn.dll) provides ”must have”  functions such as SUM, OR and LOWER
  •  the Analysis Toolpak add-in (Office.Spreadsheet.AnalysisToolpak.dll) contains more advanced functions such as ACCRINT, ISEVEN and PRICEDISC

By default, spreadsheet document have access only to these two add-ins but you can write your own add-in as well. The first step is create a .NET assembly with the appropriate settings. The second step is to make it accessible to spreadsheet document.
Add-in functions must verify the following:

  • They must be marked as public and static.
  • The containing class must be public and annotated with the [AddInFunctions] custom attribute.

Spreadsheet document discover add-ins through a SpreadsheetContext. By default, the spreadsheet context contains only the two built-in add-ins but you can create your own context with additional add-ins. If you do so, make sure you also add the built-in add-ins as well:

AddIn addIn1 = new AddIn(typeof (Office.Spreadsheet.StandardAddIn.LogicalFunctions).Assembly);
AddIn addIn2 = new AddIn(typeof (Office.Spreadsheet.AnalysisToolPak.DateFunctions).Assembly);
AddIn addIn3 = new AddIn(typeof (CustomSpreadsheetFunctions.MyFunctions).Assembly);
SpreadsheetContext context = new SpreadsheetContext(new AddIn[] {addIn1, addIn2, addIn3});


Once you have created your context, pass it to the spreadsheet document:

SpreadsheetDocument document = SpreadsheetDocument.Create(context);

Two samples demonstrate how to create and use add-ins: CustomSpreadsheetFunctions contains a custom add-in while HostCustomSpreadsheetFunctions uses this add-in.
If you decide to write your own add-in, you should make sure you avoid infinite loops and stack overflows as they would freeze the spreadsheet.

Tags:

Where are the samples?

by clearoffice 30. October 2009 07:18

The Spreadsheet comes with samples they are installed in a different directory. While the reference assemblies are installed in <Program Files>\Reference Assemblies\Clear Office, you will find the samples in <Documents>\Clear Office\Samples.

Tags:

The October CTP is out

by clearoffice 30. October 2009 07:17

This version contains better biff support.
If everything goes as scheduled, this should be last preview before the  1.0 release. If you have find any bug, please send an email to support@clearoffice.com. As always, bug reports are greatly appreciated.
This version also contains a first look at Office.Word. Office.Word.dll is still under development and may change substantially before it reaches 1.0 status. In other words, don’t panic if you see bugs.

Tags:

Opening legacy xls files

by clearoffice 30. October 2009 07:15

Does Clear Spreadsheet support legacy .xls file?
Yes
From the spreadsheet, simply select a file with an xls extension. Clear Spreadsheet will automatically convert it. You can then save to xlsx (Office 12 format).
Developers can open xls document by using the BiffFormat class.

BiffFormat format = new BiffFormat();
SpreadsheetDocument document = format.Open (xlsFileName);

Biff stands for “Binary interchange file format” - the technical name given by Microsoft.
All the code for Biff resides in a separate assembly:  Office.Spreadsheet.Formats.Biff.dll. This way, you can remove this assembly from your application to make it “legacy free”.
Also, you can open csv files (comma separated values):

CsvFormat format = new CsvFormat();
SpreadsheetDocument document = format.Open (csvFlieName);

And tsv files (tab separated values):

CsvFormat format = new CsvFormat();
SpreadsheetDocument document = format.Open (csvFlieName);

 

Tags:

Performance, performance and performance

by clearoffice 27. October 2009 03:55

One of the great benefits of using .NET everywhere is performance.

For example, consider the following code snippet.

        private static void TestMicrosoftExcel()
        {
            var xl = new ApplicationClass();
            Workbook wb = xl.Workbooks.Add(Missing.Value);
            var ws = (Worksheet) wb.Worksheets.Add(Missing.Value, Missing.Value, Missing.Value, Missing.Value);
            for (int i = 1; i < 500; i++)
                for (int j = 1; j < 100; j++)
                    ws.Cells[i, j] = 123;
            wb.SaveAs(@"c:\temp\xls1.xlsx", Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
                      XlSaveAsAccessMode.xlShared, Missing.Value, Missing.Value, Missing.Value, Missing.Value,
                      Missing.Value);
        }

It creates a simple spreadsheet with 500 * 100 = 50000 values.

Problem is, it takes 2 minutes to run.

Let's write the equivalent with Clear Spreadsheet:

        private static void TestClearSpreadsheet()
        {
            SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create();
            var worksheet = (Office.Spreadsheet.Worksheet) spreadsheetDocument.Workbook.Sheets[0];
            for (int i = 1; i < 500; i++)
                for (int j = 1; j < 100; j++)
                    worksheet[i, j].Value = 123;
            spreadsheetDocument.SaveAs(@"c:\temp\xls2.xlsx");
        }

Not only is it somewhat more elegant, it is also faster: 4 seconds.

Recap:

Microsoft Excel: 120 seconds

Clear Spreadsheet: 4 seconds

Try it for yourself!

Tags:

The september CTP is now available

by clearoffice 1. October 2009 06:22

The September Community Technical Preview (CTP) is now ready for download at www.clearoffice.com/download.html
This version includes the following improvements:

  • Support for array formulas

It is now possible to enter formulas such as “SUM(A1:A3*B1:B3)”. The input mechanism is similar to Excel: To enter a regular formula, press “Enter”; to enter an array formula, press Control+Shift+Enter.

  • Better BIFF support

BIFF is the legacy binary format (with the .xls extension). Clear Office can now open most .xls files.

  • A new WorkbookControl

The spreadsheet framework includes a new control: WorkbookControl.  The goal behind the WorkbookControl is to make workbook hosting in your application super easy. Once you have added the reference to the Clear Office assemblies, simply insert a <spreadsheet:WorkbookControl /> tag in your XAML and the Workbook will be visible in the designer.

  • Better auto fill

Auto fill has been improved. In particular, auto fill now works on time values. For example, if a sheet contains 9 AM, auto fill will yield 10 AM, 11 AM, etc


As usual, contact support@clearoffice.com for any question or problem.

 

Tags:

So what is Clear Office anyway?

by clearoffice 22. September 2009 07:28

Clear Office comes from a very simple idea: use the most advanced software platform (.NET) to create the most widely used software (Office). Hence the name Clear Office (=CLR=Common Language Runtime = .NET).  For consumers, this means a free alternative to Microsoft Office with a familiar intuitive user interface. For developers, the Spreadsheet Framework provides a straightforward set of libraries for creating and hosting Office documents.


One thing you’ll notice right away is how small Clear Office is. The download is only 2MB - it would almost fit on two floppy disks!. Once decompressed, it takes only about 4.5 MB of disk space.

The install process is super easy and should take only a few seconds. The installer simply unpacks the executables to the hard disk. In fact, you can move the files around without breaking Clear Office. Also, Clear Office runs great from a USB drive.

Once you start Spreadsheet, you’ll notice a familiar User Interface (UI). It uses the same shortcuts, colors, etc. as Excel. More importantly, it uses the same file format as Microsoft Excel. This is intentional. If you use Clear Office, you should be able to exchange documents with Microsoft Office users without any trouble.

On the developer side, you’ll notice a set of .NET assemblies. Each assembly has a very clear purpose. Also, assemblies with UI components are clearly separated from assemblies with only non visual components. For example, Office.Spreadsheet contains classes for workbooks, worksheets, cells, etc while Office.Spreadsheet.UI contains the controls (or templates), menu and commands for visually editing these documents.  These assemblies are small enough to be packaged with your application.

Tags:

Clear Office

Official Clear Office blog

Page List