Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Table has inconsistent column count error
Table has inconsistent column count error [message #669828] Wed, 11 May 2011 13:45 Go to next message
Neil Wang is currently offline Neil Wang
Messages: 103
Registered: July 2009
Senior Member
Hi,

I have a table which has 7 columns. The table has two header rows and one detail row. I remove a column programmatically like this:

RowHandle rowHandle = (RowHandle)tableHandle.getHeader().get(0);
rowHandle.getCells().get(0).drop();
rowHandle = (RowHandle)tableHandle.getHeader().get(1);
rowHandle.getCells().get(0).drop();
rowHandle = (RowHandle)tableHandle.getDetail().get(0);
rowHandle.getCells().get(0).drop();

I did a getColumnCount() on tableHandle and the count is always 7 even after a column has been removed. I opened the report design file and the error log has this error: "The table "Table("Table")" has inconsistent column count"

please advise,

Neil
Re: Table has inconsistent column count error [message #669841 is a reply to message #669828] Wed, 11 May 2011 14:37 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Neil,

Drop the column as well:


TableHandle th = (TableHandle)report.findElement("mytable");
RowHandle header = (RowHandle) th.getHeader( ).get( 0 );
header.getCells().get(0).drop();
RowHandle detail1 = (RowHandle) th.getDetail().get( 0 );
detail1.getCells().get(0).drop();
RowHandle detail2 = (RowHandle) th.getDetail().get( 1 );
RowHandle footer = (RowHandle) th.getFooter( ).get( 0 );
footer.getCells().get(0).drop();

th.getColumns().get(0).drop();

Jason

On 5/11/2011 1:45 PM, Neil Wang wrote:
> Hi,
>
> I have a table which has 7 columns. The table has two header
> rows and one detail row. I remove a column programmatically
> like this:
>
> RowHandle rowHandle =
> (RowHandle)tableHandle.getHeader().get(0);
> rowHandle.getCells().get(0).drop();
> rowHandle = (RowHandle)tableHandle.getHeader().get(1);
> rowHandle.getCells().get(0).drop();
> rowHandle = (RowHandle)tableHandle.getDetail().get(0);
> rowHandle.getCells().get(0).drop();
>
> I did a getColumnCount() on tableHandle and the count is
> always 7 even after a column has been removed. I opened the
> report design file and the error log has this error: "The
> table "Table("Table")" has inconsistent column count"
>
> please advise,
>
> Neil
>


Jason Weathersby

BIRT Exchange
Previous Topic:BIRT calling dynamic datasource multiple times
Next Topic:Problem with input parameters like ?
Goto Forum:
  


Current Time: Wed Apr 16 03:23:39 EDT 2014

Powered by FUDForum. Page generated in 0.03221 seconds