Article from BadBlue Report ()
September 28, 2002
Reading Office files is easy!
PHP ShareOffice library

Want to impress your boss by graphing or displaying data right from an Excel spreadsheet? Or reading a Word document? How about reading an Access database table?

In the past, performing these tasks took a lot (and I do mean a lot) of time and effort. But using BadBlue's PHP ShareOffice library, a single function call takes care of each of these tasks. Better still, PHP ShareOffice is a free library for PHP (with source code) that makes it easy to read Office data from your PC - or even remote - PC's.

The ShareOffice library can run on any PHP-capable web server but does need to tap into a BadBlue server for accessing the data via its built- web services. You could have a single central server collect data from multiple sources: spreadsheets, documents, databases - all on different PC's - and aggregate it into a single web page for display, graphing, etc.

PHP ShareOffice is the easiest way to read Office files. The ShareOffice library supports very simple function calls. In fact, a single function call lets you read or update an Excel spreadsheet, read a Word document into a string variable, even read Access database tables and queries.

In fact, if BadBlue is running on several PC's or servers, your scripts can read the data from any of those remote machines too.

Here's an illustration of how easy it is to use. The following example reads an Excel spreadsheet (a rectangular set of cells, A1 through K35) from the local PC and then displays the contents of two of the cells (A3 and D17):

    $arrayExcelData = array();
    $errmsg = SOExcel("127.0.0.1", "path3", "Invoices.xls", 1,
        $arrayExcelData, "A1", "K35");
    if (strlen($errmsg)) {
        echo("SOExcel Error: ".$errmsg);
    } else {
        echo("Cell  A3: ".$arrayExcelData["A3"]);
        echo("Cell D17: ".$arrayExcelData["D17"]);
    }

In a single function call, the PHP author can read an entire block of cells from a spreadsheet; update a spreadsheet; read an Access table or query; and capture an entire document into a string variable. And it's fast!

By specifying the IP address of the PC running BadBlue, the author can read data from the local PC or even a remote machine (as long as the machine hosting the data is running a copy of BadBlue).

Looking for the easiest way to get to your Microsoft Office data using PHP? ShareOffice does the job - and you can try it out for free with BadBlue Personal Edition.

Read more about PHP ShareOffice...


Published by BadBlue
Copyright © 2013 Working Resources, Inc.. All rights reserved.
Features subject to change. Use of software is subject to acceptance of terms and conditions of End User License Agreement (EULA).
Powered by IMN