O'Reilly logo

Learn OpenOffice.org Spreadsheet Macro Programming by Dr. Mark Alexander Bain

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Putting it All into a Spreadsheet

We've seen just how easy it is to get data out of a database. We can now look at actually doing something useful with the information. The most obvious thing to do is to load the data into a spreadsheet:

Sub Main Dim db As Object db = connect_to_database ("ppi") load_investigator (db) disconnect_from_database (db) End Sub Sub load_investigator (db as Object) Dim oDoc as Object Dim oURL as String Dim oSheet as Object Dim oCell as Object Dim oRowSet as Object Dim i as Integer oURL = "private:factory/scalc" oDoc = starDeskTop.loadComponentFromURL _ (oURL, "_blank", 0, Array() ) oSheet = oDoc.Sheets(0) oSheet.Name = "PPI Investigator" oRowSet = get_rowset (db, sql_select _ ("investigator", Array("SURNAME","FIRSTNAME","RATE"))) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required