I create the relation by java code like this
Code: Select all
public static void addDataRelations(StiReport stiReport,String relationName,String parentData,String parentRelationKey,String childData,String childRelationKey){
ArrayList<String> parentKey = new ArrayList<String>();
parentKey.add(parentRelationKey);
ArrayList<String> childKey = new ArrayList<String>();
childKey.add(childRelationKey);
StiDataRelation relation = new StiDataRelation();
stiReport.getDictionary().getRelations().add(relation);
relation.setAlias(relationName);
relation.setName(relationName);
relation.setNameInSource(relationName);
relation.setParentSource(stiReport.getDictionary().getDataSources().get(parentData));
relation.setChildSource(stiReport.getDictionary().getDataSources().get(childData));
relation.setChildColumns(childKey);
relation.setParentColumns(parentKey);
}
but it is not working