Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Sorting on Strings?
Sorting on Strings? [message #368121] Tue, 05 May 2009 14:09 Go to next message
Eclipse UserFriend
Originally posted by: asddd.asd.com

I have an XML as data source where all attributes are Strings:

<data order="1">
<item id="box" value="4"/>
</data>
<data order="2">
<item id="circle" value="2"/>
</data>
<data order="10">
<item id="circle" value="2"/>
</data>

Now I would like to sort on the attribute 'order', but since 'order' is a
string the result is the following order:

1
10
2

instead of:

1
2
10

Are there any build in BIRT functions that converts a string to an integer
or is it only possible to get the correct order if I change my XML format?
Re: Sorting on Strings? [message #368126 is a reply to message #368121] Tue, 05 May 2009 14:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

In your sort expression try
parseInt( row["yourxmlstring" );

Jason

mlt wrote:
> I have an XML as data source where all attributes are Strings:
>
> <data order="1">
> <item id="box" value="4"/>
> </data>
> <data order="2">
> <item id="circle" value="2"/>
> </data>
> <data order="10">
> <item id="circle" value="2"/>
> </data>
>
> Now I would like to sort on the attribute 'order', but since 'order' is
> a string the result is the following order:
>
> 1
> 10
> 2
>
> instead of:
>
> 1
> 2
> 10
>
> Are there any build in BIRT functions that converts a string to an
> integer or is it only possible to get the correct order if I change my
> XML format?
>
Re: Sorting on Strings? [message #368137 is a reply to message #368126] Tue, 05 May 2009 20:01 Go to previous message
Eclipse UserFriend
Originally posted by: asddd.asd.com

Hm seems that it parses the string to an integer automatically if I just
declare the columnmapping to have type Integer instead of type String -
nice.


"Jason Weathersby" <jasonweathersby@alltel.net> wrote in message
news:gtpihi$gpj$2@build.eclipse.org...
> In your sort expression try
> parseInt( row["yourxmlstring" );
>
> Jason
>
> mlt wrote:
>> I have an XML as data source where all attributes are Strings:
>>
>> <data order="1">
>> <item id="box" value="4"/>
>> </data>
>> <data order="2">
>> <item id="circle" value="2"/>
>> </data>
>> <data order="10">
>> <item id="circle" value="2"/>
>> </data>
>>
>> Now I would like to sort on the attribute 'order', but since 'order' is a
>> string the result is the following order:
>>
>> 1
>> 10
>> 2
>>
>> instead of:
>>
>> 1
>> 2
>> 10
>>
>> Are there any build in BIRT functions that converts a string to an
>> integer or is it only possible to get the correct order if I change my
>> XML format?
>>
Previous Topic:javascript debug failing
Next Topic:Possible to access the property editor from BIRT Engine?
Goto Forum:
  


Current Time: Fri Apr 26 03:36:54 GMT 2024

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

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

Back to the top