Its possible to set a query but how do I add the computed column?]]>2009-04-21T14:32:13-00:00Re: Add computed column to dataset (BIRT Engine)?
https://www.eclipse.org/forums/index.php/mv/msg/120627/367946/#msg_367946
Originally posted by: asd.asd.com
"JS" <asd@asd.com> wrote in message news:gskldr$htn$1@build.eclipse.org...
>I create a dataset using the BIRT engine. Is it possible to add a computed
>column to this data set?
>
>
> OdaDataSetHandle dataSetHandle = elementFactory.newOdaDataSet( name,
> "org.eclipse.birt.report.data.oda.xml.dataSet" );
> dataSetHandle.setDataSource(dataSrcName);
> dataSetHandle.setQueryText(query);
>
> // Add computed columns
> ComputedColumn column = StructureFactory.createComputedColumn();
> String cname = "var1";
> String cexp = "if(row[\"id\"]==\"var1\")row[\"value\"]";
> column.setExpression(cexp);
> // dataSetHandle.add... ??
>
> Its possible to set a query but how do I add the computed column?]]>2009-04-21T14:42:57-00:00