ColumnHint ch5 = StructureFactory.createColumnHint( ); ch5.setProperty( "columnName", "Open" );
cs6 = StructureFactory.createComputedColumn( ); cs6.setName( "Volume" ); cs6.setExpression( "row[\"Volume\"]" ); cs6.setDataType( "integer" );
	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(6), new Array(6), new Array(6), new Array(6),"//$NON-NLS-1$						+ "new Array(6), new Array(6), new Array(6), new Array(6));"//$NON-NLS-1$						+ "sourcedata[0][0] = \"3/1/2005\"; "//$NON-NLS-1$						+ "sourcedata[0][1] = 2.77;"//$NON-NLS-1$						+ "sourcedata[0][2] = 2.73;"//$NON-NLS-1$						+ "sourcedata[0][3] = 2.69; "//$NON-NLS-1$						+ "sourcedata[0][4] = 2.71;"//$NON-NLS-1$						+ "sourcedata[0][5] = 341900;"//$NON-NLS-1$						+ "sourcedata[1][0] = \"3/2/2005\"; "//$NON-NLS-1$						+ "sourcedata[1][1] = 2.8;"//$NON-NLS-1$						+ "sourcedata[1][2] = 2.64;"//$NON-NLS-1$						+ "sourcedata[1][3] = 2.6; "//$NON-NLS-1$						+ "sourcedata[1][4] = 2.71;"//$NON-NLS-1$						+ "sourcedata[1][5] = 249900;"//$NON-NLS-1$						+ "sourcedata[2][0] = \"3/3/2005\"; "//$NON-NLS-1$						+ "sourcedata[2][1] = 2.6;"//$NON-NLS-1$						+ "sourcedata[2][2] = 2.28;"//$NON-NLS-1$						+ "sourcedata[2][3] = 2.13; "//$NON-NLS-1$						+ "sourcedata[2][4] = 2.59;"//$NON-NLS-1$						+ "sourcedata[2][5] = 394800;"//$NON-NLS-1$						+ "sourcedata[3][0] = \"3/4/2005\"; "//$NON-NLS-1$						+ "sourcedata[3][1] = 2.87;"//$NON-NLS-1$						+ "sourcedata[3][2] = 2.87;"//$NON-NLS-1$						+ "sourcedata[3][3] = 2.03; "//$NON-NLS-1$						+ "sourcedata[3][4] = 2.21;"//$NON-NLS-1$						+ "sourcedata[3][5] = 358200;"//$NON-NLS-1$						+ "sourcedata[4][0] = \"3/5/2005\"; "//$NON-NLS-1$						+ "sourcedata[4][1] = 2.48;"//$NON-NLS-1$						+ "sourcedata[4][2] = 2.26;"//$NON-NLS-1$						+ "sourcedata[4][3] = 2.16; "//$NON-NLS-1$						+ "sourcedata[4][4] = 2.39;"//$NON-NLS-1$						+ "sourcedata[4][5] = 339000;"//$NON-NLS-1$						+ "sourcedata[5][0] = \"3/6/2005\"; "//$NON-NLS-1$						+ "sourcedata[5][1] = 2.98;"//$NON-NLS-1$						+ "sourcedata[5][2] = 2.86;"//$NON-NLS-1$						+ "sourcedata[5][3] = 2.04; "//$NON-NLS-1$						+ "sourcedata[5][4] = 2.19;"//$NON-NLS-1$						+ "sourcedata[5][5] = 221000;"//$NON-NLS-1$						+ "sourcedata[6][0] = \"3/7/2005\"; "//$NON-NLS-1$						+ "sourcedata[6][1] = 2.87;"//$NON-NLS-1$						+ "sourcedata[6][2] = 2.17;"//$NON-NLS-1$						+ "sourcedata[6][3] = 2.14; "//$NON-NLS-1$						+ "sourcedata[6][4] = 2.62;"//$NON-NLS-1$						+ "sourcedata[6][5] = 183600;"//$NON-NLS-1$						+ "sourcedata[7][0] = \"3/8/2005\"; "//$NON-NLS-1$						+ "sourcedata[7][1] = 2.8;"//$NON-NLS-1$						+ "sourcedata[7][2] = 2.78;"//$NON-NLS-1$						+ "sourcedata[7][3] = 2.65; "//$NON-NLS-1$						+ "sourcedata[7][4] = 2.66;"//$NON-NLS-1$						+ "sourcedata[7][5] = 194800;" );//$NON-NLS-1$		// Set fetch( ) in code		dataSetHandle.setFetch( "if ( i < 8 ){"//$NON-NLS-1$				+ "row[\"Date\"] = sourcedata[i][0];"//$NON-NLS-1$				+ "row[\"High\"] = sourcedata[i][1];"//$NON-NLS-1$				+ "row[\"Close\"] = sourcedata[i][2];"//$NON-NLS-1$				+ "row[\"Low\"] = sourcedata[i][3];"//$NON-NLS-1$				+ "row[\"Open\"] = sourcedata[i][4];"//$NON-NLS-1$				+ "row[\"Volume\"] = sourcedata[i][5];" + "i++;"//$NON-NLS-1$//$NON-NLS-2$				+ "return true;}" + "else return false;" );//$NON-NLS-1$//$NON-NLS-2$		// Set Output Columns in Data Set		ColumnHint ch1 = StructureFactory.createColumnHint( );		ch1.setProperty( "columnName", "Date" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch2 = StructureFactory.createColumnHint( );		ch2.setProperty( "columnName", "High" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch3 = StructureFactory.createColumnHint( );		ch3.setProperty( "columnName", "Close" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch4 = StructureFactory.createColumnHint( );		ch4.setProperty( "columnName", "Low" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch5 = StructureFactory.createColumnHint( );		ch5.setProperty( "columnName", "Open" );//$NON-NLS-1$//$NON-NLS-2$		ColumnHint ch6 = StructureFactory.createColumnHint( );		ch6.setProperty( "columnName", "Volume" );//$NON-NLS-1$//$NON-NLS-2$		PropertyHandle columnHint = dataSetHandle				.getPropertyHandle( ScriptDataSetHandle.COLUMN_HINTS_PROP );		columnHint.addItem( ch1 );		columnHint.addItem( ch2 );		columnHint.addItem( ch3 );		columnHint.addItem( ch4 );		columnHint.addItem( ch5 );		columnHint.addItem( ch6 );		// Set Preview Results columns in Data Set		ResultSetColumn rs1 = StructureFactory.createResultSetColumn( );		rs1.setColumnName( "Date" );//$NON-NLS-1$		rs1.setPosition( new Integer( 1 ) );		rs1.setDataType( "date-time" );//$NON-NLS-1$		ResultSetColumn rs2 = StructureFactory.createResultSetColumn( );		rs2.setColumnName( "High" );//$NON-NLS-1$		rs2.setPosition( new Integer( 2 ) );		rs2.setDataType( "float" );//$NON-NLS-1$		ResultSetColumn rs3 = StructureFactory.createResultSetColumn( );		rs3.setColumnName( "Close" );//$NON-NLS-1$		rs3.setPosition( new Integer( 3 ) );		rs3.setDataType( "float" );//$NON-NLS-1$		ResultSetColumn rs4 = StructureFactory.createResultSetColumn( );		rs4.setColumnName( "Low" );//$NON-NLS-1$		rs4.setPosition( new Integer( 4 ) );		rs4.setDataType( "float" );//$NON-NLS-1$		ResultSetColumn rs5 = StructureFactory.createResultSetColumn( );		rs5.setColumnName( "Open" );//$NON-NLS-1$		rs5.setPosition( new Integer( 5 ) );		rs5.setDataType( "float" );//$NON-NLS-1$		ResultSetColumn rs6 = StructureFactory.createResultSetColumn( );		rs6.setColumnName( "Volume" );//$NON-NLS-1$		rs6.setPosition( new Integer( 6 ) );		rs6.setDataType( "integer" );//$NON-NLS-1$		PropertyHandle resultSet = dataSetHandle				.getPropertyHandle( ScriptDataSetHandle.RESULT_SET_PROP );		resultSet.addItem( rs1 );		resultSet.addItem( rs2 );		resultSet.addItem( rs3 );		resultSet.addItem( rs4 );		resultSet.addItem( rs5 );		resultSet.addItem( rs6 );		reportDesignHandle.getDataSets( ).add( dataSetHandle );	}