Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP & OpenOffice
Message
From
20/09/2005 20:53:15
 
 
To
20/09/2005 08:37:20
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
01051142
Message ID:
01051517
Views:
6
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
Map
View

Click here to load this message in the networking platform