The problem of relation

Stimulsoft Reports.JAVA discussion
Post Reply
heqichao
Posts: 113
Joined: Fri Mar 04, 2016 9:02 am

The problem of relation

Post 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
heqichao
Posts: 113
Joined: Fri Mar 04, 2016 9:02 am

Re: The problem of relation

Post 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
Vadim
Posts: 409
Joined: Tue Apr 23, 2013 11:23 am

Re: The problem of relation

Post by Vadim »

Hello.
Just add next code:

Code: Select all

relation.setDictionary(stiReport.getDictionary());
Post Reply