Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HIde Excel Pivot Table Total Row
Message
De
05/10/2016 06:41:47
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
HIde Excel Pivot Table Total Row
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
SAMBA Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01641632
Message ID:
01641632
Vues:
91
Dear All,

I need to hide the Grand Total row of the excel pivot table. I try the following code but it cant work. kindly advise. Thanks

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

oWorkBook = oExcel.workBooks.add()

oTargetSheet = oWorkBook.sheets.add()
oTargetSheet.Cells(1,1) = "Production Report by Machine"
mRow = 1
mRange = "A"+TRANSFORM(mRow+2)
oTargetRange = oTargetSheet.range(mRange)

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

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

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

oPivotTable.PivotFields("cType").orientation = 1&& row
oPivotTable.PivotFields("mc").orientation = 2 && column
oPivotTable.PivotFields("qty").orientation = 4 && data


For Each pvtFld In oPivotTable.PivotFields
pvtFld.Subtotals(1) = .T.
pvtFld.SubTotals(1) = .F.
Next pvtFld
oPivotTable.ManualUpdate = .F.
Répondre
Fil
Voir

Click here to load this message in the networking platform