Information générale
Catégorie:
Produits tierce partie
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement