フリー・レポート・データ加工クラス

8678 ワード

package nc.report.fdcpm.dynamiccost;

import com.ufida.dataset.IContext;
import nc.pub.fa.report.base.FAReportCodeProcess;
import nc.pub.smart.data.DataSet;
import nc.pub.smart.metadata.Field;
import nc.pub.smart.metadata.MetaData;
import nc.pub.smart.model.code.CodeProcessor;
import nc.vo.pub.lang.MultiLangText;

public class ReportTest extends FAReportCodeProcess {

	private final int HEAD_COLUMN_NUM = 2;
	
	public ReportTest(CodeProcessor processor) {
		super(processor);
	}

	public DataSet getDataSet(IContext context) {
		DataSet dataSet = new DataSet();
		Field fields[] = new Field[HEAD_COLUMN_NUM];
		MetaData metaData = new MetaData();
	 	fields[0] = (Field) addhead("user_code", " ").clone();
	 	fields[1] = (Field) addhead("user_name", " ").clone();
		metaData.addField(fields);
		dataSet.setMetaData(metaData);
		Object[][] obj = new Object[0][HEAD_COLUMN_NUM];
		dataSet.setDatas(obj);
		return dataSet;
	}
	
	private Field addhead(String name, String text) {
		Field field = new Field();
		MultiLangText mlText = new MultiLangText();
		field.setFldname(name);
		mlText.setText(text);
		field.setMultiLangText(mlText);
		return field;
	}
}