[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.birt] Re: Drop a column from TableHandle
|
- From: Jason Weathersby <jasonweathersby@xxxxxxxxxx>
- Date: Thu, 23 Oct 2008 12:16:18 -0400
- Newsgroups: eclipse.birt
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.17 (Windows/20080914)
Raju,
Here is an example that was done in the beforeFactory script
importPackage(Packages.org.eclipse.birt.report.model.api.elements);
importPackage(Packages.org.eclipse.birt.report.model.api);
th1 =
reportContext.getReportRunnable().designHandle.getDesignHandle().findElement("mytable1");
//th1.findColumn(0).setSuppressDuplicates(true);
rowHandle = th1.getDetail().getContents().get(0);
cellHandle = rowHandle.getCells().getContents().get(0);
cellHandle.drop();
rowHandle = th1.getHeader().getContents().get(0);
cellHandle = rowHandle.getCells().getContents().get(0);
cellHandle.drop();
rowHandle = th1.getFooter().getContents().get(0);
cellHandle = rowHandle.getCells().getContents().get(0);
cellHandle.drop();
th1.findColumn(0).dropAndClear()
It deletes the first column. You may have to do more if your columns span.
Jason
raju wrote:
Greetings all
How can i delete a particular column from data table(TableHandle) .I
have used following code but i am sure its not the right way , because i
am not getting right output with that.
Here is the code
RowHandle rowHandle =
(RowHandle)dataTable.getDetail().getContents().get(0);
for(int k = 0 ; k<rowHandle.getCells().getContents().size(); k++){
CellHandle cellHandle =
(CellHandle)rowHandle.getCells().getContents().get(k);
for(int m = 0 ;m<cellHandle.getContent().getContents().size() ; m++){
DataItemHandle dataItemHandle=
(DataItemHandle)cellHandle.getContent().getContents().get(m);
if(dataItemHandle.getResultSetColumn().equals("CITY")){
cellHandle.drop();
cellHandle.dropAndClear();
}
}
}
with the above code it just delete the particular cell,but i want to
delete the column of that table .
Help me in this regard.