ColumnHint ch2 = StructureFactory.createColumnHint( ); ch2.setProperty( "columnName", "Product" );
cs2 = StructureFactory.createComputedColumn( ); cs2.setName( "Product" ); cs2.setExpression( "row[\"Product\"]" ); cs2.setDataType( "string" );
	private void createDataSets( ) throws SemanticException	{		// Data Set		ScriptDataSetHandle dataSetHandle = elementFactory				.newScriptDataSet( "Data Set" );//$NON-NLS-1$		dataSetHandle.setDataSource( "Data Source" );//$NON-NLS-1$		// Set open( ) in code		dataSetHandle				.setOpen( "i=0;"//$NON-NLS-1$						+ "sourcedata = new Array( new Array(3), new Array(3), new Array(3),  new Array(3));"//$NON-NLS-1$						+ "sourcedata[0][0] = 10; "//$NON-NLS-1$						+ "sourcedata[0][1] = \"Ice Bella\";"//$NON-NLS-1$						+ "sourcedata[0][2] = 304;"//$NON-NLS-1$						+ "sourcedata[1][0] = 10; "//$NON-NLS-1$						+ "sourcedata[1][1] = \"Nola Dicci\";"//$NON-NLS-1$						+ "sourcedata[1][2] = 258;"//$NON-NLS-1$						+ "sourcedata[2][0] = 11; "//$NON-NLS-1$						+ "sourcedata[2][1] = \"Ice Bella\";"//$NON-NLS-1$						+ "sourcedata[2][2] = 202;"//$NON-NLS-1$						+ "sourcedata[3][0] = 11; "//$NON-NLS-1$						+ "sourcedata[3][1] = \"Nola Dicci\";"//$NON-NLS-1$						+ "sourcedata[3][2] = 181;" );//$NON-NLS-1$		// Set fetch( ) in code		dataSetHandle.setFetch( "if ( i < 4 ){"//$NON-NLS-1$				+ "row[\"Month\"] = sourcedata[i][0];"//$NON-NLS-1$				+ "row[\"Product\"] = sourcedata[i][1];"//$NON-NLS-1$				+ "row[\"Amount\"] = sourcedata[i][2];"//$NON-NLS-1$				+ "i++;"//$NON-NLS-1$				+ "return true;}" + "else return false;" );//$NON-NLS-1$//$NON-NLS-2$		// Set Output Columns in Data Set		ColumnHint ch1 = StructureFactory.createColumnHint( );		ch1.setProperty( "columnName", "Month" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch2 = StructureFactory.createColumnHint( );		ch2.setProperty( "columnName", "Product" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch3 = StructureFactory.createColumnHint( );		ch3.setProperty( "columnName", "Amount" );//$NON-NLS-1$//$NON-NLS-2$		PropertyHandle columnHint = dataSetHandle				.getPropertyHandle( ScriptDataSetHandle.COLUMN_HINTS_PROP );		columnHint.addItem( ch1 );		columnHint.addItem( ch2 );		columnHint.addItem( ch3 );		// Set Preview Results columns in Data Set		ResultSetColumn rs1 = StructureFactory.createResultSetColumn( );		rs1.setColumnName( "Month" );//$NON-NLS-1$		rs1.setPosition( new Integer( 1 ) );		rs1.setDataType( "integer" );//$NON-NLS-1$		ResultSetColumn rs2 = StructureFactory.createResultSetColumn( );		rs2.setColumnName( "Product" );//$NON-NLS-1$		rs2.setPosition( new Integer( 2 ) );		rs2.setDataType( "string" );//$NON-NLS-1$		ResultSetColumn rs3 = StructureFactory.createResultSetColumn( );		rs3.setColumnName( "Amount" );//$NON-NLS-1$		rs3.setPosition( new Integer( 3 ) );		rs3.setDataType( "integer" );//$NON-NLS-1$		PropertyHandle resultSet = dataSetHandle				.getPropertyHandle( ScriptDataSetHandle.RESULT_SET_PROP );		resultSet.addItem( rs1 );		resultSet.addItem( rs2 );		resultSet.addItem( rs3 );		reportDesignHandle.getDataSets( ).add( dataSetHandle );	}