Code: Select all
dim fieldABNummerPercent
'fieldABNummerPercent = Fields.getByIndex(0)
fieldABNummerPercent =Fields.getByName("Auftrag")
fieldABNummerPercent.Orientation = com.sun.star.sheet.DataPilotFieldOrientation.DATA
fieldABNummerPercent.Function = com.sun.star.sheet.GeneralFunction.COUNT
dim reference as new com.sun.star.sheet.DataPilotFieldReference
fieldABNummerPercent.reference = reference
reference.ReferenceType=com.sun.star.sheet.DataPilotFieldReferenceType.TOTAL_PERCENTAGE '7
reference.referenceField="Auftrag"
reference.referenceItemType=0
'reference.referenceitemName=""
fieldABNummerPercent.setName("gesamt %")