Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Problem with Sorting table data
Problem with Sorting table data [message #559333] Thu, 16 September 2010 12:10 Go to next message
JP Redro is currently offline JP Redro
Messages: 167
Registered: July 2009
Location: India
Senior Member

Hi All,

As per the following thread i have embedded sorting script in befroeFactory. But i am getting error message. Please suggest me.

http://www.eclipse.org/forums/index.php?S=effb3763c6d4f471e8 4910218211526d&t=msg&th=159352

My Code is:
importPackage(Packages.org.eclipse.birt.report.model.api);
importPackage(Packages.org.eclipse.birt.report.model.api.ele ments);
importPackage(Packages.com.ibm.icu.util);
importPackage(Packages.org.eclipse.birt.data.engine.api);

delm = reportContext.getReportRunnable().designHandle.getDesignHand le().findElement( "LITEM");
sc = StructureFactory.createSortKey();
sc.setKey("row[\"LNO\"]");
sc.setDirection("desc");
ph = delm.getPropertyHandle(TableHandle.SORT_PROP);
ph.addItem(sc);

Getting following error :

Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getPropertyHandle" of null (<inline>#10) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRu ntime.java:3240)

Thanks,
JP.


Thanks,
JP
Re: Problem with Sorting table data [message #559455 is a reply to message #559333] Thu, 16 September 2010 17:00 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

JP,

the error is that LITEM is not found. Did you name the report item in
its general properties. Also try this if you are using 2.3.2 or above:
delm = reportContext.getDesignHandle().findElement( "LITEM");


Jason


On 9/16/2010 8:10 AM, JP wrote:
> delm = reportContext.getReportRunnable().designHandle.getDesignHand
> le().findElement( "LITEM");
Re: Problem with Sorting table data [message #559619 is a reply to message #559455] Fri, 17 September 2010 12:04 Go to previous messageGo to next message
pasupuleti  is currently offline pasupuleti
Messages: 1
Registered: September 2010
Junior Member
Hi Jason ,

we are using 2.2.1 version

Yes it is named in general properties.

Data soure : XML type

Our requirement as followings

We need to sort the information based on the line number before loading into the report layout . Could please suggest ,how to achieve it in birt 2.2.1.

Thanks,
PA



[Updated on: Fri, 17 September 2010 12:05]

Report message to a moderator

Re: Problem with Sorting table data [message #559679 is a reply to message #559619] Fri, 17 September 2010 14:51 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Where are you getting line number? Do you want it to be row number?
BTW can you try:
delm = reportContext.getReportRunnable().designHandle.findElement(
"LITEM");

Jason

On 9/17/2010 8:04 AM, pasupuleti wrote:
> Hi Jason ,
>
> we are using 2.2.1 version
> yes it is name the report item in
> general properties.
>
> Data soure : XML type
> Our requirement as followings
>
> We need to sort the information based on the line number before loading
> into the report layout . Could please suggest ,how to achieve it in birt
> 2.2.1.
>
> Thanks,
> PA
>
>
>
>
Previous Topic:Difference between sorting in BIRT 2.5 and 2.6 (Grouping and sorting in charts)
Next Topic:Arrange Column data in a row
Goto Forum:
  


Current Time: Fri Sep 19 06:07:20 GMT 2014

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

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