Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Deleting a column in a table
Deleting a column in a table [message #507737] Thu, 14 January 2010 14:11 Go to next message
john mcteague is currently offline john mcteagueFriend
Messages: 15
Registered: July 2009
Junior Member
Is there a simpler way to drop a column on a table than the following:
TableHandle table = ....
int colIdx = ....
ColumnHandle colHandle = table.findColumn(colIdx);
colHandle.dropAndClear();
Iterator detailIt = table.getDetail().iterator();
while(detailIt.hasNext()){
    RowHandle handle = (RowHandle)detailIt.next();
    handle.getCells().get(colIdx).dropAndClear();
}
Iterator footerIt = table.getFooter().iterator();
while(footerIt.hasNext()){
    RowHandle handle = (RowHandle)footerIt.next();
    handle.getCells().get(colIdx).dropAndClear();
}
Iterator headerIt = table.getHeader().iterator();
while(headerIt.hasNext()){
    RowHandle handle = (RowHandle)headerIt.next();
    handle.getCells().get(colIdx).dropAndClear();
}


It seems somewhat long winded....
Re: Deleting a column in a table [message #507785 is a reply to message #507737] Thu, 14 January 2010 16:22 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Agreed. Can you open an enhancement request to add a call to the
TableHandle to delete a specific column?

Jason

john mcteague wrote:
> Is there a simpler way to drop a column on a table than the following:
> TableHandle table = ....
> int colIdx = ....
> ColumnHandle colHandle = table.findColumn(colIdx);
> colHandle.dropAndClear();
> Iterator detailIt = table.getDetail().iterator();
> while(detailIt.hasNext()){
> RowHandle handle = (RowHandle)detailIt.next();
> handle.getCells().get(colIdx).dropAndClear();
> }
> Iterator footerIt = table.getFooter().iterator();
> while(footerIt.hasNext()){
> RowHandle handle = (RowHandle)footerIt.next();
> handle.getCells().get(colIdx).dropAndClear();
> }
> Iterator headerIt = table.getHeader().iterator();
> while(headerIt.hasNext()){
> RowHandle handle = (RowHandle)headerIt.next();
> handle.getCells().get(colIdx).dropAndClear();
> }
>
> It seems somewhat long winded....
Previous Topic:BIRT : header and footer
Next Topic:Unable to load report design in BIRT 2.5.x
Goto Forum:
  


Current Time: Fri Apr 26 03:39:44 GMT 2024

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

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

Back to the top