Skip to main content



      Home
Home » Archived » BIRT » Is it possible to insert/remove table columns dynamically in BIRT?
Is it possible to insert/remove table columns dynamically in BIRT? [message #99026] Wed, 14 December 2005 10:11 Go to next message
Eclipse UserFriend
Hi,

I’m trying ( BIRT 1.0.1) to insert columns to a table dynamically, but I
can not find the right method in the API’s.

Is it possible to insert/remove table columns dynamically in BIRT?
If yes how to do that?

Thanks,

Said
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #101201 is a reply to message #99026] Wed, 21 December 2005 12:16 Go to previous messageGo to next message
Eclipse UserFriend
I believe you would have to use the Report Engine API which has a handle to
the report desgin.
You would take the handle load the Report using the DE API modify the table
and then reload it in the Engine. This could be done all in memory using
the engine.openReportDesign( InputStream) method.

Jason Weathersby
BIRT PMC

"S.Taaouati" <said.taaouati@remain.nl> wrote in message
news:1bb5cbf0fd08c664de913a24af61129b$1@www.eclipse.org...
> Hi,
>
> I
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #101530 is a reply to message #101201] Thu, 22 December 2005 04:33 Go to previous messageGo to next message
Eclipse UserFriend
In order to modify the table I’m using this:
// add a new column to “table”
ColumnHandle colH = table.getElementFactory().newTableColumn();

TableHandle item = table.getElementFactory().newTableItem("tableItem", 3);

Further there is no method in TableHandle object that can add a new
column.

Can you give an example how to do this please?
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #101809 is a reply to message #101530] Thu, 22 December 2005 15:34 Go to previous messageGo to next message
Eclipse UserFriend
Try doing this

TableHandle th = factory.newTableItem("test",2);
SlotHandle slot = th.getColumns();
ColumnHandle ch = factory.newTableColumn();
slot.add(ch);
design.getBody().add( th);

HTH
Jason Weathersby
BIRT PMC

"S.Taaouati" <said.taaouati@remain.nl> wrote in message
news:972f2f458f3aece3471c36575d4087f9$1@www.eclipse.org...
> In order to modify the table I
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #102006 is a reply to message #101809] Fri, 23 December 2005 03:41 Go to previous messageGo to next message
Eclipse UserFriend
The following code creates a new table with two columns instead of add a
column to the existing table.

TableHandle th = factory.newTableItem("test",2);
SlotHandle slot = th.getColumns();
ColumnHandle ch = factory.newTableColumn();
slot.add(ch);
design.getBody().add( th);

What I try to do is this:

table1:
----------------------------
| col1 | col2 |
| | |
---------------------------

add col3 to tabl1:
------------------------------------
| col1 | col2 | col3 |
| | | |
------------------------------------

remove col3 from table1:
----------------------------
| col1 | col2 |
| | |
---------------------------


Thanks,
Said
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #102133 is a reply to message #102006] Fri, 23 December 2005 13:57 Go to previous messageGo to next message
Eclipse UserFriend
Adding and Deleting Columns requires worrying about groups and the number of
rows.
I was able to get this to work using the TableHandleAdapter class, which is
used by the GUI.
Might not be the right thing to do, but here is a snippet.

//name of my table
TableHandle th = (TableHandle)design.findElement("test");
TableHandlerAdapter hta = new TableHandleAdapter( th, null);
tha.insertColumn(1, 1);

or

tha.deleteColumn(1);

HTH

Jason

"S.Taaouati" <said.taaouati@remain.nl> wrote in message
news:3fa59c9e582034a17dbea382c23cbfd3$1@www.eclipse.org...
> The following code creates a new table with two columns instead of add a
> column to the existing table.
>
> TableHandle th = factory.newTableItem("test",2);
> SlotHandle slot = th.getColumns();
> ColumnHandle ch = factory.newTableColumn();
> slot.add(ch);
> design.getBody().add( th);
>
> What I try to do is this:
>
> table1: ----------------------------
> | col1 | col2 | | | |
> ---------------------------
>
> add col3 to tabl1:
> ------------------------------------
> | col1 | col2 | col3 |
> | | | |
> ------------------------------------
>
> remove col3 from table1:
> ----------------------------
> | col1 | col2 | | | |
> ---------------------------
>
>
> Thanks,
> Said
>
>
>
>
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #102472 is a reply to message #102133] Tue, 27 December 2005 03:19 Go to previous messageGo to next message
Eclipse UserFriend
The class TableHandleAdapter consists of insert/delete column, but it is
not included in the API’s.

How can I use it in mine application?

Thanks,

Said
Re: Is it possible to insert/remove table columns dynamically in BIRT? [message #103703 is a reply to message #102472] Tue, 03 January 2006 14:22 Go to previous message
Eclipse UserFriend
Said,

If you download the source you can look at the TableHandleAdapter class.
I used it by importing it

import
org.eclipse.birt.report.designer.core.model.schematic.TableH andleAdapter

It is in core.jar.

Jason

"S.Taaouati" <said.taaouati@remain.nl> wrote in message
news:b2c8ae1be6e459b707d53c72873556a8$1@www.eclipse.org...
> The class TableHandleAdapter consists of insert/delete column, but it is
> not included in the API
Previous Topic:I have some problem in showng image in html correctly
Next Topic:Problem with number alignment
Goto Forum:
  


Current Time: Sat Jun 07 05:18:46 EDT 2025

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

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

Back to the top