Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Is row[0]==row["0"]? Or should it be?
Is row[0]==row["0"]? Or should it be? [message #132105] Fri, 17 February 2006 11:13 Go to next message
Peter Fopma is currently offline Peter FopmaFriend
Messages: 81
Registered: July 2009
Member
Here is another interesting thing we found...

We have a dataset where a column is named 0 (zero). Dragging the
dataset to the reports yields a table where the above column is
addressed as row["0"]. The preview shows the expected values.

Since the data is needed for further calculation we changed the
data element and added an assignment to a global array:

theArray[rowCounter++]=row["0"];
row["0"]

I expected the preview to remain unchanged and have a copy of the
values in the array named theArray, but...
Now the column in the preview contains the values of the index column -
row[0] -
and the array is assigned with the same index values.

Changing the code to

theArray[rowCounter++]=row[2]; // WLOG: assuming the column named 0 is at
index 2
row[2]

shows the correct result. Renaming the column to "Fred1" "Berta12" or
anything that is not a number works, too.

For the sane this should not be a problem since numbering metadata is not
exactly self-explanatory. But still, I think this is not the way it is
meant
to work, or is it!?

Thanks,
Peter Fopma
Re: Is row[0]==row["0"]? Or should it be? [message #132326 is a reply to message #132105] Fri, 17 February 2006 16:05 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Peter,

Naming the column 0 is probably not very descriptive either, but
this may be a bug. Can you log a bugzilla entry?

Jason

"Peter Fopma" <peter.fopma@ifb-group.com> wrote in message
news:7b5a5fcc9cc00636e4403840314948bb$1@www.eclipse.org...
> Here is another interesting thing we found...
>
> We have a dataset where a column is named 0 (zero). Dragging the
> dataset to the reports yields a table where the above column is
> addressed as row["0"]. The preview shows the expected values.
>
> Since the data is needed for further calculation we changed the
> data element and added an assignment to a global array:
>
> theArray[rowCounter++]=row["0"];
> row["0"]
>
> I expected the preview to remain unchanged and have a copy of the
> values in the array named theArray, but...
> Now the column in the preview contains the values of the index column -
> row[0] -
> and the array is assigned with the same index values.
>
> Changing the code to
>
> theArray[rowCounter++]=row[2]; // WLOG: assuming the column named 0 is at
> index 2
> row[2]
>
> shows the correct result. Renaming the column to "Fred1" "Berta12" or
> anything that is not a number works, too.
>
> For the sane this should not be a problem since numbering metadata is not
> exactly self-explanatory. But still, I think this is not the way it is
> meant
> to work, or is it!?
>
> Thanks,
> Peter Fopma
>
Previous Topic:Problem with X axis scale
Next Topic:serious problem with cascading parameters
Goto Forum:
  


Current Time: Fri Apr 26 22:14:06 GMT 2024

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

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

Back to the top