/*******************************************************************************
 * Copyright 2017 Bstek
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License.  You may obtain a copy
 * of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations under
 * the License.
 ******************************************************************************/
package com.bstek.ureport.build.cell;

import java.util.List;

import com.bstek.ureport.build.BindData;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.definition.ConditionPropertyItem;
import com.bstek.ureport.model.Cell;

/**
 * @author Jacky.gao
 * @since 2016年11月1日
 */
public class NoneExpandBuilder implements CellBuilder {

	@Override
	public Cell buildCell(List<BindData> dataList, Cell cell, Context context) {
		Object obj=null;
		List<Object> bindData=null;
		for(BindData data:dataList){
			if(obj==null){
				if(data.getLabel()==null){
					obj=data.getValue();					
				}else{
					obj=data.getLabel();										
				}
			}else{
				if(data.getLabel()==null){
					obj=obj+","+data.getValue();					
				}else{
					obj=obj+","+data.getLabel();					
				}
			}
			bindData=data.getDataList();
		}
		cell.setData(obj);
		cell.setBindData(bindData);
		List<ConditionPropertyItem> conditionPropertyItems=cell.getConditionPropertyItems();
		if(conditionPropertyItems!=null && conditionPropertyItems.size()>0){
			context.getReport().getLazyComputeCells().add(cell);
		}else{
			cell.doFormat();
			cell.doDataWrapCompute(context);
		}
		return cell;
	}
}

@@ -1177,16 +1177,217 @@
 text) %7B%0A
+%09%09if(dataList.size()==1)%7B%0A%09%09%09BindData bindData=dataList.get(0);%0A%09%09%09cell.setData(bindData.getValue());%0A%09%09%09cell.setFormatData(bindData.getLabel());%0A%09%09%09cell.setBindData(bindData.getDataList());%0A%09%09%7Delse%7B%0A%09
 %09%09Object
@@ -1397,16 +1397,17 @@
 j=null;%0A
+%09
 %09%09List%3CO
@@ -1428,16 +1428,17 @@
 a=null;%0A
+%09
 %09%09for(Bi
@@ -1463,16 +1463,17 @@
 st)%7B%0A%09%09%09
+%09
 if(obj==
@@ -1475,24 +1475,25 @@
 obj==null)%7B%0A
+%09
 %09%09%09%09if(data.
@@ -1512,24 +1512,25 @@
 null)%7B%0A%09%09%09%09%09
+%09
 obj=data.get
@@ -1535,32 +1535,33 @@
 etValue();%09%09%09%09%09%0A
+%09
 %09%09%09%09%7Delse%7B%0A%09%09%09%09%09
@@ -1556,24 +1556,25 @@
 %7Delse%7B%0A%09%09%09%09%09
+%09
 obj=data.get
@@ -1592,26 +1592,28 @@
 %09%09%09%09%09%09%09%0A%09%09%09%09
+%09
 %7D%0A
+%09
 %09%09%09%7Delse%7B%0A%09%09
@@ -1610,24 +1610,25 @@
 %09%7Delse%7B%0A%09%09%09%09
+%09
 if(data.getL
@@ -1638,24 +1638,25 @@
 l()==null)%7B%0A
+%09
 %09%09%09%09%09obj=obj
@@ -1682,31 +1682,33 @@
 );%09%09%09%09%09%0A%09%09%09%09
+%09
 %7Delse%7B%0A
+%09
 %09%09%09%09%09obj=obj
@@ -1742,15 +1742,18 @@
 %09%09%09%09
+%09
 %7D%0A
+%09
 %09%09%09%7D%0A
+%09
 %09%09%09b
@@ -1782,18 +1782,20 @@
 st();%0A%09%09
+%09
 %7D%0A
+%09
 %09%09cell.s
@@ -1807,16 +1807,17 @@
 a(obj);%0A
+%09
 %09%09cell.s
@@ -1838,16 +1838,20 @@
 dData);%0A
+%09%09%7D%0A
 %09%09List%3CC

修复链接参数使用#表达式取值时如果当前单元格存在数据映射当展开数据只有一条时取值为映射后值的BUG