Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Adding column mappings using the Birt Engine API ?
Adding column mappings using the Birt Engine API ? [message #501691] Thu, 03 December 2009 14:00 Go to next message
Eclipse UserFriend
Originally posted by: ddd.asd.com

I have made an application that opens an already existing .rptdesign file
which uses a xml file as data source and a few data sets.

In this application I would like to add one or more new column mappings to
one of the data sets. Any ideas on how to do this using the Birt Engine API?
Re: Adding column mappings using the Birt Engine API ? [message #501756 is a reply to message #501691] Thu, 03 December 2009 17:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Do you want to change the xml query? or just add columns to a table?
I am attaching an example of creating a report with an xml datasource.
Also attached is the sample xml data used.

Jason

import java.io.File;
import java.io.IOException;
import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.model.api.CellHandle;
import org.eclipse.birt.report.model.api.DataItemHandle;
import org.eclipse.birt.report.model.api.DesignConfig;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.DesignEngine;
import org.eclipse.birt.report.model.api.ElementFactory;
import org.eclipse.birt.report.model.api.IDesignEngine;
import org.eclipse.birt.report.model.api.IDesignEngineFactory;
import org.eclipse.birt.report.model.api.LabelHandle;
import org.eclipse.birt.report.model.api.PropertyHandle;
import org.eclipse.birt.report.model.api.ReportDesignHandle;
import org.eclipse.birt.report.model.api.RowHandle;
import org.eclipse.birt.report.model.api.OdaDataSetHandle;
import org.eclipse.birt.report.model.api.OdaDataSourceHandle;
import org.eclipse.birt.report.model.api.SessionHandle;
import org.eclipse.birt.report.model.api.StructureFactory;
import org.eclipse.birt.report.model.api.TableHandle;
import org.eclipse.birt.report.model.api.activity.SemanticException ;
import org.eclipse.birt.report.model.api.command.ContentException;
import org.eclipse.birt.report.model.api.command.NameException;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConst ants;
import org.eclipse.birt.report.model.api.elements.structures.Comput edColumn;
import org.eclipse.birt.report.model.api.metadata.IMetaDataDictiona ry;
import org.eclipse.birt.report.model.elements.interfaces.IReportIte mModel;
import org.eclipse.birt.report.model.elements.interfaces.IStyleMode l;

import com.ibm.icu.util.ULocale;

public class XMLReport
{

ReportDesignHandle reportDesignHandle = null;

ElementFactory elementFactory = null;

IMetaDataDictionary dict = null;

ComputedColumn cs1, cs2, cs3 = null;

public static void main( String[] args ) throws SemanticException,
IOException
{
new XMLReport( ).createReport( );
}

void createReport( ) throws SemanticException, IOException
{
//Configure the Engine and start the Platform
DesignConfig config = new DesignConfig( );


config.setBIRTHome("C:/birt/birt-runtime-2_5_1/birt-runtime-2_5_1/ReportEngine ");
IDesignEngine engine = null;
try{


Platform.startup( config );
IDesignEngineFactory factory = (IDesignEngineFactory) Platform
.createFactoryObject(
IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );
engine = factory.createDesignEngine( config );

}catch( Exception ex){
ex.printStackTrace();
}


SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH ) ;


// Create a new report
reportDesignHandle = session.createDesign( );

// Element factory is used to create instances of BIRT elements.
elementFactory = reportDesignHandle.getElementFactory( );

dict = new DesignEngine( null ).getMetaData( );

createMasterPages( );
createDataSources( );
createDataSets( );
createBody( );

//OdaDataSourceHandle dataSourceHandle =
(OdaDataSourceHandle)reportDesignHandle.findDataSource("myxmldatasource ");


String outputPath = "output";//$NON-NLS-1$
File outputFolder = new File( outputPath );
if ( !outputFolder.exists( ) && !outputFolder.mkdir( ) )
{
throw new IOException( "Can not create the output folder" );//$NON-NLS-1$
}
reportDesignHandle.saveAs( "output/desample/XMLReport.rptdesign"
);//$NON-NLS-1$//$NON-NLS-2$
System.out.println("finished");
}





private void createDataSources( ) throws SemanticException
{
OdaDataSourceHandle dataSourceHandle =
elementFactory.newOdaDataSource("Data Source",
"org.eclipse.birt.report.data.oda.xml");
dataSourceHandle.setProperty("FILELIST", "C:/temp/xmltest2.xml");
reportDesignHandle.getDataSources( ).add( dataSourceHandle );
}

private void createDataSets( ) throws SemanticException
{
// Data Set

OdaDataSetHandle dsHandle = elementFactory.newOdaDataSet( "Data Set",
"org.eclipse.birt.report.data.oda.xml.dataSet" );
dsHandle.setDataSource( "Data Source" );
dsHandle.setQueryText(
" table0#-TNAME-#table0#:#[/people/person/name]#:#{name;String ;} " );

reportDesignHandle.getDataSets( ).add( dsHandle );


}

private void createMasterPages( ) throws ContentException, NameException
{
DesignElementHandle simpleMasterPage =
elementFactory.newSimpleMasterPage( "Master Page" );//$NON-NLS-1$
reportDesignHandle.getMasterPages( ).add( simpleMasterPage );
}



private void createBody( ) throws SemanticException
{



TableHandle table = elementFactory.newTableItem( null, 3, 1, 1, 1 );
table.setProperty( IStyleModel.TEXT_ALIGN_PROP,
DesignChoiceConstants.TEXT_ALIGN_CENTER );
table.setWidth( "80%" );//$NON-NLS-1$
table.setProperty( IReportItemModel.DATA_SET_PROP, "Data Set"
);//$NON-NLS-1$

PropertyHandle computedSet = table.getColumnBindings( );
cs1 = StructureFactory.createComputedColumn( );

cs1.setName("Name");
cs1.setExpression( "dataSetRow[\"name\"]" );//$NON-NLS-1$
computedSet.addItem( cs1 );



// Header
RowHandle header = (RowHandle) table.getHeader( ).get( 0 );

CellHandle tcell = (CellHandle) header.getCells( ).get( 0 );
LabelHandle label = elementFactory.newLabel( null );
label.setText( "Name" );//$NON-NLS-1$
tcell.getContent( ).add( label );



DataItemHandle data = null;
// Detail
RowHandle detail = (RowHandle) table.getDetail( ).get( 0 );
tcell = (CellHandle) detail.getCells( ).get( 0 );
data = elementFactory.newDataItem( null );
data.setResultSetColumn( cs1.getName( ) );
tcell.getContent( ).add( data );


reportDesignHandle.getBody( ).add( table );


}


}

//xml data

<people>
<person>
<name>Jonathan</name>
<nicknames>
<nickname>John</nickname>
<nickname>Jon</nickname>
</nicknames>
</person>
<person>
<name>Steven</name>
<nicknames>
<nickname>Steve</nickname>
</nicknames>
</person>
</people>

klm wrote:
> I have made an application that opens an already existing .rptdesign
> file which uses a xml file as data source and a few data sets.
>
> In this application I would like to add one or more new column mappings
> to one of the data sets. Any ideas on how to do this using the Birt
> Engine API?
Re: Adding column mappings using the Birt Engine API ? [message #501893 is a reply to message #501756] Fri, 04 December 2009 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ddd.asd.com

"Jason Weathersby" <jasonweathersby@windstream.net> wrote in message
news:hf8rgb$2pl$1@build.eclipse.org...
> Do you want to change the xml query? or just add columns to a table?
> I am attaching an example of creating a report with an xml datasource.
> Also attached is the sample xml data used.
>


I only need to add a column to an existing data set not to the table. I
current get the query text like this:

DataSetHandle dsh = reportDesignHandle.findDataSet(dataSetName);
System.out.println(dsh.getProperty("queryText"));

which gives me (for the already existing parameters):

table0#-TNAME-#table0#:#[/root/section/subsection]#:#{Name;S TRING;[@id= "Name"]/@value},{Year;STRING;
[@id="Year"]/@value}, ....

Now if I would like to add the column: "Address" it should end up looking
like this in the updated queryText:

{Address;STRING;[@id="Address"]/@value}


One way to do this is to manually update the queryText (insert the xml
formatted expression to the already existing queryText) but maybe there is a
more elegant way to do this?






> Jason
>
> import java.io.File;
> import java.io.IOException;
> import org.eclipse.birt.core.framework.Platform;
> import org.eclipse.birt.report.model.api.CellHandle;
> import org.eclipse.birt.report.model.api.DataItemHandle;
> import org.eclipse.birt.report.model.api.DesignConfig;
> import org.eclipse.birt.report.model.api.DesignElementHandle;
> import org.eclipse.birt.report.model.api.DesignEngine;
> import org.eclipse.birt.report.model.api.ElementFactory;
> import org.eclipse.birt.report.model.api.IDesignEngine;
> import org.eclipse.birt.report.model.api.IDesignEngineFactory;
> import org.eclipse.birt.report.model.api.LabelHandle;
> import org.eclipse.birt.report.model.api.PropertyHandle;
> import org.eclipse.birt.report.model.api.ReportDesignHandle;
> import org.eclipse.birt.report.model.api.RowHandle;
> import org.eclipse.birt.report.model.api.OdaDataSetHandle;
> import org.eclipse.birt.report.model.api.OdaDataSourceHandle;
> import org.eclipse.birt.report.model.api.SessionHandle;
> import org.eclipse.birt.report.model.api.StructureFactory;
> import org.eclipse.birt.report.model.api.TableHandle;
> import org.eclipse.birt.report.model.api.activity.SemanticException ;
> import org.eclipse.birt.report.model.api.command.ContentException;
> import org.eclipse.birt.report.model.api.command.NameException;
> import org.eclipse.birt.report.model.api.elements.DesignChoiceConst ants;
> import
> org.eclipse.birt.report.model.api.elements.structures.Comput edColumn;
> import org.eclipse.birt.report.model.api.metadata.IMetaDataDictiona ry;
> import org.eclipse.birt.report.model.elements.interfaces.IReportIte mModel;
> import org.eclipse.birt.report.model.elements.interfaces.IStyleMode l;
>
> import com.ibm.icu.util.ULocale;
>
> public class XMLReport
> {
>
> ReportDesignHandle reportDesignHandle = null;
>
> ElementFactory elementFactory = null;
>
> IMetaDataDictionary dict = null;
>
> ComputedColumn cs1, cs2, cs3 = null;
>
> public static void main( String[] args ) throws SemanticException,
> IOException
> {
> new XMLReport( ).createReport( );
> }
>
> void createReport( ) throws SemanticException, IOException
> {
> //Configure the Engine and start the Platform
> DesignConfig config = new DesignConfig( );
>
>
> config.setBIRTHome("C:/birt/birt-runtime-2_5_1/birt-runtime-2_5_1/ReportEngine ");
> IDesignEngine engine = null;
> try{
>
>
> Platform.startup( config );
> IDesignEngineFactory factory = (IDesignEngineFactory) Platform
> .createFactoryObject(
> IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );
> engine = factory.createDesignEngine( config );
>
> }catch( Exception ex){
> ex.printStackTrace();
> }
>
>
> SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH ) ;
>
>
> // Create a new report
> reportDesignHandle = session.createDesign( );
>
> // Element factory is used to create instances of BIRT elements.
> elementFactory = reportDesignHandle.getElementFactory( );
>
> dict = new DesignEngine( null ).getMetaData( );
>
> createMasterPages( );
> createDataSources( );
> createDataSets( );
> createBody( );
>
> //OdaDataSourceHandle dataSourceHandle =
> (OdaDataSourceHandle)reportDesignHandle.findDataSource("myxmldatasource ");
>
>
> String outputPath = "output";//$NON-NLS-1$
> File outputFolder = new File( outputPath );
> if ( !outputFolder.exists( ) && !outputFolder.mkdir( ) )
> {
> throw new IOException( "Can not create the output folder" );//$NON-NLS-1$
> }
> reportDesignHandle.saveAs(
> "output/desample/XMLReport.rptdesign" );//$NON-NLS-1$//$NON-NLS-2$
> System.out.println("finished");
> }
>
>
>
>
>
> private void createDataSources( ) throws SemanticException
> {
> OdaDataSourceHandle dataSourceHandle =
> elementFactory.newOdaDataSource("Data Source",
> "org.eclipse.birt.report.data.oda.xml");
> dataSourceHandle.setProperty("FILELIST", "C:/temp/xmltest2.xml");
> reportDesignHandle.getDataSources( ).add( dataSourceHandle );
> }
>
> private void createDataSets( ) throws SemanticException
> {
> // Data Set
>
> OdaDataSetHandle dsHandle = elementFactory.newOdaDataSet( "Data Set",
> "org.eclipse.birt.report.data.oda.xml.dataSet" );
> dsHandle.setDataSource( "Data Source" );
> dsHandle.setQueryText(
> " table0#-TNAME-#table0#:#[/people/person/name]#:#{name;String ;} " );
>
> reportDesignHandle.getDataSets( ).add( dsHandle );
>
>
> }
>
> private void createMasterPages( ) throws ContentException, NameException
> {
> DesignElementHandle simpleMasterPage =
> elementFactory.newSimpleMasterPage( "Master Page" );//$NON-NLS-1$
> reportDesignHandle.getMasterPages( ).add( simpleMasterPage );
> }
>
>
>
> private void createBody( ) throws SemanticException
> {
>
>
>
> TableHandle table = elementFactory.newTableItem( null, 3, 1, 1, 1 );
> table.setProperty( IStyleModel.TEXT_ALIGN_PROP,
> DesignChoiceConstants.TEXT_ALIGN_CENTER );
> table.setWidth( "80%" );//$NON-NLS-1$
> table.setProperty( IReportItemModel.DATA_SET_PROP, "Data
> Set" );//$NON-NLS-1$
>
> PropertyHandle computedSet = table.getColumnBindings( );
> cs1 = StructureFactory.createComputedColumn( );
>
> cs1.setName("Name");
> cs1.setExpression( "dataSetRow[\"name\"]" );//$NON-NLS-1$
> computedSet.addItem( cs1 );
>
>
>
> // Header
> RowHandle header = (RowHandle) table.getHeader( ).get( 0 );
>
> CellHandle tcell = (CellHandle) header.getCells( ).get( 0 );
> LabelHandle label = elementFactory.newLabel( null );
> label.setText( "Name" );//$NON-NLS-1$
> tcell.getContent( ).add( label );
>
>
>
> DataItemHandle data = null;
> // Detail
> RowHandle detail = (RowHandle) table.getDetail( ).get( 0 );
> tcell = (CellHandle) detail.getCells( ).get( 0 );
> data = elementFactory.newDataItem( null );
> data.setResultSetColumn( cs1.getName( ) );
> tcell.getContent( ).add( data );
>
>
> reportDesignHandle.getBody( ).add( table );
>
>
> }
>
>
> }
>
> //xml data
>
> <people>
> <person>
> <name>Jonathan</name>
> <nicknames>
> <nickname>John</nickname>
> <nickname>Jon</nickname>
> </nicknames>
> </person>
> <person>
> <name>Steven</name>
> <nicknames>
> <nickname>Steve</nickname>
> </nicknames>
> </person>
> </people>
>
> klm wrote:
>> I have made an application that opens an already existing .rptdesign file
>> which uses a xml file as data source and a few data sets.
>>
>> In this application I would like to add one or more new column mappings
>> to one of the data sets. Any ideas on how to do this using the Birt
>> Engine API?
Re: Adding column mappings using the Birt Engine API ? [message #501974 is a reply to message #501893] Fri, 04 December 2009 15:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I do not think there currently is another method to do this. Modifying
the query text is the most direct way.

Jason

klm wrote:
>
> "Jason Weathersby" <jasonweathersby@windstream.net> wrote in message
> news:hf8rgb$2pl$1@build.eclipse.org...
>> Do you want to change the xml query? or just add columns to a table?
>> I am attaching an example of creating a report with an xml datasource.
>> Also attached is the sample xml data used.
>>
>
>
> I only need to add a column to an existing data set not to the table. I
> current get the query text like this:
>
> DataSetHandle dsh = reportDesignHandle.findDataSet(dataSetName);
> System.out.println(dsh.getProperty("queryText"));
>
> which gives me (for the already existing parameters):
>
> table0#-TNAME-#table0#:#[/root/section/subsection]#:#{Name;S TRING;[@id= "Name"]/@value},{Year;STRING;
> [@id="Year"]/@value}, ....
>
> Now if I would like to add the column: "Address" it should end up
> looking like this in the updated queryText:
>
> {Address;STRING;[@id="Address"]/@value}
>
>
> One way to do this is to manually update the queryText (insert the xml
> formatted expression to the already existing queryText) but maybe there
> is a more elegant way to do this?
>
>
>
>
>
>
>> Jason
>>
>> import java.io.File;
>> import java.io.IOException;
>> import org.eclipse.birt.core.framework.Platform;
>> import org.eclipse.birt.report.model.api.CellHandle;
>> import org.eclipse.birt.report.model.api.DataItemHandle;
>> import org.eclipse.birt.report.model.api.DesignConfig;
>> import org.eclipse.birt.report.model.api.DesignElementHandle;
>> import org.eclipse.birt.report.model.api.DesignEngine;
>> import org.eclipse.birt.report.model.api.ElementFactory;
>> import org.eclipse.birt.report.model.api.IDesignEngine;
>> import org.eclipse.birt.report.model.api.IDesignEngineFactory;
>> import org.eclipse.birt.report.model.api.LabelHandle;
>> import org.eclipse.birt.report.model.api.PropertyHandle;
>> import org.eclipse.birt.report.model.api.ReportDesignHandle;
>> import org.eclipse.birt.report.model.api.RowHandle;
>> import org.eclipse.birt.report.model.api.OdaDataSetHandle;
>> import org.eclipse.birt.report.model.api.OdaDataSourceHandle;
>> import org.eclipse.birt.report.model.api.SessionHandle;
>> import org.eclipse.birt.report.model.api.StructureFactory;
>> import org.eclipse.birt.report.model.api.TableHandle;
>> import org.eclipse.birt.report.model.api.activity.SemanticException ;
>> import org.eclipse.birt.report.model.api.command.ContentException;
>> import org.eclipse.birt.report.model.api.command.NameException;
>> import org.eclipse.birt.report.model.api.elements.DesignChoiceConst ants;
>> import
>> org.eclipse.birt.report.model.api.elements.structures.Comput edColumn;
>> import org.eclipse.birt.report.model.api.metadata.IMetaDataDictiona ry;
>> import
>> org.eclipse.birt.report.model.elements.interfaces.IReportIte mModel;
>> import org.eclipse.birt.report.model.elements.interfaces.IStyleMode l;
>>
>> import com.ibm.icu.util.ULocale;
>>
>> public class XMLReport
>> {
>>
>> ReportDesignHandle reportDesignHandle = null;
>>
>> ElementFactory elementFactory = null;
>>
>> IMetaDataDictionary dict = null;
>>
>> ComputedColumn cs1, cs2, cs3 = null;
>>
>> public static void main( String[] args ) throws SemanticException,
>> IOException
>> {
>> new XMLReport( ).createReport( );
>> }
>>
>> void createReport( ) throws SemanticException, IOException
>> {
>> //Configure the Engine and start the Platform
>> DesignConfig config = new DesignConfig( );
>>
>>
>> config.setBIRTHome("C:/birt/birt-runtime-2_5_1/birt-runtime-2_5_1/ReportEngine ");
>>
>> IDesignEngine engine = null;
>> try{
>>
>>
>> Platform.startup( config );
>> IDesignEngineFactory factory = (IDesignEngineFactory) Platform
>> .createFactoryObject(
>> IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY );
>> engine = factory.createDesignEngine( config );
>>
>> }catch( Exception ex){
>> ex.printStackTrace();
>> }
>>
>>
>> SessionHandle session = engine.newSessionHandle( ULocale.ENGLISH ) ;
>>
>>
>> // Create a new report
>> reportDesignHandle = session.createDesign( );
>>
>> // Element factory is used to create instances of BIRT elements.
>> elementFactory = reportDesignHandle.getElementFactory( );
>>
>> dict = new DesignEngine( null ).getMetaData( );
>>
>> createMasterPages( );
>> createDataSources( );
>> createDataSets( );
>> createBody( );
>>
>> //OdaDataSourceHandle dataSourceHandle =
>> (OdaDataSourceHandle)reportDesignHandle.findDataSource("myxmldatasource ");
>>
>>
>>
>> String outputPath = "output";//$NON-NLS-1$
>> File outputFolder = new File( outputPath );
>> if ( !outputFolder.exists( ) && !outputFolder.mkdir( ) )
>> {
>> throw new IOException( "Can not create the output folder" );//$NON-NLS-1$
>> }
>> reportDesignHandle.saveAs( "output/desample/XMLReport.rptdesign"
>> );//$NON-NLS-1$//$NON-NLS-2$
>> System.out.println("finished");
>> }
>>
>>
>>
>>
>>
>> private void createDataSources( ) throws SemanticException
>> {
>> OdaDataSourceHandle dataSourceHandle =
>> elementFactory.newOdaDataSource("Data Source",
>> "org.eclipse.birt.report.data.oda.xml");
>> dataSourceHandle.setProperty("FILELIST", "C:/temp/xmltest2.xml");
>> reportDesignHandle.getDataSources( ).add( dataSourceHandle );
>> }
>>
>> private void createDataSets( ) throws SemanticException
>> {
>> // Data Set
>>
>> OdaDataSetHandle dsHandle = elementFactory.newOdaDataSet( "Data Set",
>> "org.eclipse.birt.report.data.oda.xml.dataSet" );
>> dsHandle.setDataSource( "Data Source" );
>> dsHandle.setQueryText(
>> " table0#-TNAME-#table0#:#[/people/person/name]#:#{name;String ;} " );
>>
>> reportDesignHandle.getDataSets( ).add( dsHandle );
>>
>>
>> }
>>
>> private void createMasterPages( ) throws ContentException, NameException
>> {
>> DesignElementHandle simpleMasterPage =
>> elementFactory.newSimpleMasterPage( "Master Page" );//$NON-NLS-1$
>> reportDesignHandle.getMasterPages( ).add( simpleMasterPage );
>> }
>>
>>
>>
>> private void createBody( ) throws SemanticException
>> {
>>
>>
>>
>> TableHandle table = elementFactory.newTableItem( null, 3, 1, 1, 1 );
>> table.setProperty( IStyleModel.TEXT_ALIGN_PROP,
>> DesignChoiceConstants.TEXT_ALIGN_CENTER );
>> table.setWidth( "80%" );//$NON-NLS-1$
>> table.setProperty( IReportItemModel.DATA_SET_PROP, "Data Set"
>> );//$NON-NLS-1$
>>
>> PropertyHandle computedSet = table.getColumnBindings( );
>> cs1 = StructureFactory.createComputedColumn( );
>>
>> cs1.setName("Name");
>> cs1.setExpression( "dataSetRow[\"name\"]" );//$NON-NLS-1$
>> computedSet.addItem( cs1 );
>>
>>
>>
>> // Header
>> RowHandle header = (RowHandle) table.getHeader( ).get( 0 );
>>
>> CellHandle tcell = (CellHandle) header.getCells( ).get( 0 );
>> LabelHandle label = elementFactory.newLabel( null );
>> label.setText( "Name" );//$NON-NLS-1$
>> tcell.getContent( ).add( label );
>>
>>
>>
>> DataItemHandle data = null;
>> // Detail
>> RowHandle detail = (RowHandle) table.getDetail( ).get( 0 );
>> tcell = (CellHandle) detail.getCells( ).get( 0 );
>> data = elementFactory.newDataItem( null );
>> data.setResultSetColumn( cs1.getName( ) );
>> tcell.getContent( ).add( data );
>>
>>
>> reportDesignHandle.getBody( ).add( table );
>>
>>
>> }
>>
>>
>> }
>>
>> //xml data
>>
>> <people>
>> <person>
>> <name>Jonathan</name>
>> <nicknames>
>> <nickname>John</nickname>
>> <nickname>Jon</nickname>
>> </nicknames>
>> </person>
>> <person>
>> <name>Steven</name>
>> <nicknames>
>> <nickname>Steve</nickname>
>> </nicknames>
>> </person>
>> </people>
>>
>> klm wrote:
>>> I have made an application that opens an already existing .rptdesign
>>> file which uses a xml file as data source and a few data sets.
>>>
>>> In this application I would like to add one or more new column
>>> mappings to one of the data sets. Any ideas on how to do this using
>>> the Birt Engine API?
>
Re: Adding column mappings using the Birt Engine API ? [message #1686690 is a reply to message #501974] Thu, 19 March 2015 09:58 Go to previous messageGo to next message
Yudhesh Bhawsar is currently offline Yudhesh BhawsarFriend
Messages: 2
Registered: March 2015
Junior Member
I tried using Jason's code, but I'm getting this OSGI Framework error.
And I'm not able to resolve it. Could you please help Jason.
Re: Adding column mappings using the Birt Engine API ? [message #1687533 is a reply to message #1686690] Thu, 19 March 2015 17:49 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Could you post your error stack? Also, could you provide a sample of what you've got? And, do you definitely want to use Java or would script in the report design be an option?

Michael

Developer Evangelist, Silanis
Previous Topic:Page break
Next Topic:Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc
Goto Forum:
  


Current Time: Thu Apr 25 20:40:43 GMT 2024

Powered by FUDForum. Page generated in 0.03611 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top