Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Add computed column to dataset (BIRT Engine)?
Add computed column to dataset (BIRT Engine)? [message #367945] Tue, 21 April 2009 10:32 Go to next message
Eclipse User
Originally posted by: asd.asd.com

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?
Re: Add computed column to dataset (BIRT Engine)? [message #367946 is a reply to message #367945] Tue, 21 April 2009 10:42 Go to previous message
Eclipse User
Originally posted by: asd.asd.com

Sometime a little googling helps :-)


http://wiki.eclipse.org/DerbySampleDE.java

in the bottom.


"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?
Previous Topic:Using parameters from multiple data sets in a single table?
Next Topic:Filtering Groups (DataSets) in the Data Cube Builder
Goto Forum:
  


Current Time: Fri Apr 18 22:05:53 EDT 2014

Powered by FUDForum. Page generated in 0.01525 seconds