EDFs in Reports
You can also add EDFs to the reports or report overrides in EPT. The following example explains how can you add EDFs to the retrieval and as filters to the reports.
<ReportList xmlns="http://www.onenetwork.com/Platform"> <Report> <Name>AttributeTestModelEDFsReport</Name> <SqlDef Name="AttributeTestModelEDFsReport" GroupName="AttributeTestModel"><![CDATA[ select ZBKS_ATTRIBUTE_TEST_MODEL.SYS_ATTRIBUTE_TEST_MODEL_ID, ZBKS_ATTRIBUTE_TEST_MODEL.TEST_NK1, $MY_ENT_NAME$ as ENTERPRISENAME, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestAddress,ADDRESS_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestBoolean,BOOLEAN_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDate,DATE_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDateRangeStartDate,START_DATE_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDateRangeEndDate,END_DATE_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDistanceAmount,DISTANCE_AMOUNT_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDistanceUOM,DISTANCE_UOM_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDouble,DOUBLE_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestDuration,DURATION_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestString,STRING_EDF}, ${selectAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestStringEnum,STRING_ENUM_EDF}, SYS_SECOND_LEVEL_ID, TEST_NK2, ${selectAttribute:ZBKS.SecondLevel,EPT.BookstoreEPT.SecondLevelTestString,STRING_CHILD_EDF}, from ZBKS_ATTRIBUTE_TEST_MODEL LEFT OUTER JOIN ZBKS_SECOND_LEVEL ON ZBKS_ATTRIBUTE_TEST_MODEL.SYS_ATTRIBUTE_TEST_MODEL_ID = ZBKS_SECOND_LEVEL.SYS_ATTRIBUTE_TEST_MODEL_ID where ZBKS_ATTRIBUTE_TEST_MODEL.VC_ID = $MY_VC_ID$ ${filterIfNotNull:STRING_EDF, ${filterAttribute:ZBKS.AttributeTestModel,EPT.BookstoreEPT.TestString,STRING_EDF}} ]]> </SqlDef> <ActionDef> <PrimaryModelLevelType>ZBKS.AttributeTestModel</PrimaryModelLevelType> </ActionDef> <Filters bindSqlNulls="true"> <CustomFilterField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestString</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>STRING</Type> <SimpleMapping sqlName="STRING_EDF"/> </CustomFilterField> </Filters> <Retrieval> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>SysAttributeTestModelId</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>LONG</Type> <SimpleMapping sqlName="SYS_ATTRIBUTE_TEST_MODEL_ID"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.SecondLevel" category="PDF"> <FieldName>SysSecondLevelId</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>LONG</Type> <SimpleMapping sqlName="SYS_SECOND_LEVEL_ID"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>TestNK1</FieldName> </FieldRef> <Hidden>false</Hidden> <Editable>true</Editable> <Type>STRING</Type> <SimpleMapping sqlName="TEST_NK1"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestAddress</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>ADDRESS</Type> <SimpleMapping sqlName="ADDRESS_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestBoolean</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>BOOLEAN</Type> <SimpleMapping sqlName="BOOLEAN_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDate</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>DATE</Type> <SimpleMapping sqlName="DATE_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDateRangeStartDate</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>DATE</Type> <SimpleMapping sqlName="START_DATE_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDateRangeEndDate</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>DATE</Type> <SimpleMapping sqlName="END_DATE_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDateRange</FieldName> </FieldRef> <Type>COMPOSITE</Type> <Sortable>true</Sortable> <CompositeFieldType name="DateRange"> <Component name="EPT.SampleEnterprise.TestDateRangeStartDate" type="DATE"/> <Component name="EPT.SampleEnterprise.TestDateRangeEndDate" type="DATE"/> </CompositeFieldType> <SimpleMapping sqlName="START_DATE_EDF"/> <SortMapping sqlName="START_DATE_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDistanceAmount</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>DOUBLE</Type> <SimpleMapping sqlName="DISTANCE_AMOUNT_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDistanceUOM</FieldName> </FieldRef> <Hidden>true</Hidden> <Type>STRING_ENUMERATION</Type> <EnumerationType>DistanceUOM</EnumerationType> <SimpleMapping sqlName="DISTANCE_UOM_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDistance</FieldName> </FieldRef> <Type>COMPOSITE</Type> <Sortable>true</Sortable> <CompositeFieldType name="Distance"> <Component name="EPT.SampleEnterprise.TestDistanceAmount" type="DOUBLE"/> <Component name="EPT.SampleEnterprise.TestDistanceUOM" type="STRING_ENUMERATION"/> </CompositeFieldType> <SimpleMapping sqlName="DISTANCE_AMOUNT_EDF"/> <SortMapping sqlName="DISTANCE_AMOUNT_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDouble</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>DOUBLE</Type> <SimpleMapping sqlName="DOUBLE_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestDuration</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>DURATION</Type> <SimpleMapping sqlName="DURATION_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestString</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>STRING</Type> <SimpleMapping sqlName="STRING_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.AttributeTestModel" category="PDF"> <FieldName>EPT.SampleEnterprise.TestStringEnum</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>STRING_ENUMERATION</Type> <EnumerationValues> <Value>Value1</Value> <Value>Value2</Value> <Value>Value3</Value> </EnumerationValues> <SimpleMapping sqlName="STRING_ENUM_EDF"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.SecondLevel" category="PDF"> <FieldName>TestNK2</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>STRING</Type> <SimpleMapping sqlName="TEST_NK2"/> </CustomRetrievalField> <CustomRetrievalField> <FieldRef levelType="ZBKS.SecondLevel" category="PDF"> <FieldName>EPT.SampleEnterprise.SecondLevelTestString</FieldName> </FieldRef> <Hidden>false</Hidden> <Type>STRING</Type> <SimpleMapping sqlName="STRING_CHILD_EDF"/> </CustomRetrievalField> </Retrieval> </Report></ReportList>selectAttribute - Returns the SQL to select the atttribute from attribute (or its subtype) table based on provided model level, attribute name and field alias. Following are the parameters:
modelLevelType - Model level type, e.g. 'ZBKS.Book'
attributeName - Fully-qualified attribute name. e.g. 'EPT.BookstoreEPT.TestString'
attributeAlias - Attribute field name alias which will be used in filter and retrieval simpleMapping. e.g. 'TEST_STRING_EDF'
tableAlias - (optional) Table alias if using in the query otherwise defaults to table name based on the provided modelLevelType. e.g. 'book' or 'ZBKS_BOOK'
filterAttribute - Returns the SQL to filter the query based on the provided attribute. Parameters for filterAttribute macro is same as of selectAttribute macro.
You will need to provide fully-qualified EDF name in reports/overrides filters/retreivals definition to make it work properly otherwise you will get the ClassCastException on execution.