# and retrieve the values using the field types.
# Now we can print the column headings, then iterate through the tasks # First we'll build a list of column headings and a list of field typesĬolumn_types = Ĭolumn_names.append(str(field.getAlias()))Ĭolumn_types.append(field.getFieldType()) # Let's build a report showing the ID, Name and any custom fields for each task. ).getFieldTypeClass() = FieldTypeClass.TASK, project.getCustomFields()))įield.getFieldType().toString() + '\t' + field.getAlias()) Task_custom_fields = list(filter(lambda field: field.getFieldType( Let's filter that list down to just task custom # Ah! We have custom field definitions here for different entity types Print(field.getFieldType().getFieldTypeClass().toString() + '\t' +
# Just to get started, let's see what tasks we have Unfortunately I don't have a lot of examples in Python for MPXJ yet, but I'm working on it! In the meantime I've adapted your code to show how you can retrieve details of all the custom fields present in a project, then filter those down just to task fields, and then finally use the field type to dynamically retrieve the values for the custom fields, and also use the 'alias' as a column heading: import jpypeįrom net.sf.mpxj.reader import UniversalProjectReader