Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP & OpenOffice
Message
De
20/09/2005 20:53:15
 
 
À
20/09/2005 08:37:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
01051142
Message ID:
01051517
Vues:
14
Thanks for the reply.

I know I can export to excel pivot table and the file can opened by openOffice.

But I client don't have excel installed. So I need to deal with openOffice to suit his requirement.

I used to use the following code to export data to excel pivot table.

oExcel = CREATEOBJECT("excel.application")
oExcel.application.Visible = .T.

oWorkBook = oExcel.workBooks.add()

oTargetSheet = oWorkBook.sheets.add()
oTargetRange = oTargetSheet.range("A2")

oPivotCache = oWorkBook.pivotCaches.add(2) && External data

oPivotCache.connection = "OLEDB;Provider=vfpOleDb.1;data source = c:\erp"
oPivotCache.commandText = "SELECT * FROM tPaperBal"

oPivotTable = oPivotCache.createPivotTable(oTargetRange,"pivotTable")

oPivotTable.PivotFields("width").orientation = 1&& row
oPivotTable.PivotFields("code").orientation = 2 && column
oPivotTable.PivotFields("supNo").orientation = 2 && column
oPivotTable.PivotFields("balQty1").orientation = 4 && data


Thanks.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform