Page 1 of 1

The problem of relation

Posted: Wed May 25, 2016 12:34 pm
by heqichao
Hello,
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

Re: The problem of relation

Posted: Wed May 25, 2016 1:27 pm
by heqichao
I create the relation by java code and it is not working like this Image
but review is nothing in jobs_name
Image.

but when I set the relation (only click the button of ok) I can see the data about jobs_name
Image
Image

Re: The problem of relation

Posted: Thu May 26, 2016 12:30 pm
by Vadim
Hello.
Just add next code:

Code: Select all

relation.setDictionary(stiReport.getDictionary());