General information
Category:
Third party products
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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only