|
Re: Table Sorting [message #733759 is a reply to message #733697] |
Wed, 05 October 2011 14:56 |
|
Can you post the whole report?
Jason
On 10/5/2011 8:50 AM, vandhanaa.r wrote:
> Using the BIRT Designer version 2.1.3
> BIRT runtime 2.2.2
>
> My problem is when i click on the table header of a particular column
> ,the table gets sorted according to the sort order of that column in
> BIRT designer preview , but not in runtime.
> Here is what code tried with help of this forum.
>
> beforeFactory - sortkeyCriteria
> =reportContext.getHttpServletRequest().getRequestURL() + "?"
> +reportContext.getHttpServletRequest().getQueryString();
>
> Table Header URI option script is importPackage(Packages.java.lang);
>
> var temp = sortkeyCriteria ;
> var targetURL = new String();
>
> if(temp.indexOf("_overwrite=") != -1 ){
>
> targetURL = temp.substring(0, temp.indexOf("&_overwrite") -1);
> }else{
> targetURL = temp;
> }
>
> targetURL += "&_overwrite=true";
> targetURL += "&_srt=a";
>
> Sort Key - selecting the sort key based on the click of column,
>
> if( params["srt"].value =="Column1" ){
> row["Column1"];
> }
> else if(params["srt"].value =="Column2"){
> row["Column2"];
> }
> else if(params["srt"].value =="Column3"){
> row["Column3"];
> }
>
> Sort Direction - Ascending
> Can anyone let me know where am i going wrong
|
|
|
|
Re: Table Sorting [message #734415 is a reply to message #734394] |
Fri, 07 October 2011 16:52 |
|
Can you try:
importPackage(Packages.java.lang);
var temp = xyz;
var targetURL = new String();
if(temp.indexOf("&__overwrite=") != -1 ){
targetURL = temp.substring(0, temp.indexOf("&__overwrite="));
}else{
targetURL = temp;
}
targetURL += "&__overwrite=true";
targetURL += "&srt=column3";
and take the var keyword off of counter in the table prepare script:
counter = 0;
Jason
On 10/7/2011 12:00 PM, vandhanaa.r wrote:
> Attached with this the report
>
> Thanks Jason !
|
|
|
|
Re: Table Sorting [message #734434 is a reply to message #734420] |
Fri, 07 October 2011 18:31 |
|
What happens when you click on it?
Jason
On 10/7/2011 1:29 PM, vandhanaa.r wrote:
> I tried the __overwrite instead of _overwrite in my original report but
> still sorting not working in the runtime.
>
> The counter was part of the table for a different thing (not for sorting).
>
> I am using the BIRT 2.2.2 runtime default web.xml . By default the
> _Overrite attribute will be set to true right . Any changes needed in
> web.xml ?
|
|
|
|
Re: Table Sorting [message #734972 is a reply to message #734509] |
Mon, 10 October 2011 14:33 |
|
I thought it was failing in the viewer? How are you running it when it
fails. You can always log out some debug info in the beforeFactory to
check it. Use something like"
importPackage( Packages.java.io );
out = new PrintWriter( new FileWriter( "c:/temp/rpevents.txt", true ) );
out.println( "beforeFactory " + addyourvariableshere);
out.close();
Jason
On 10/8/2011 12:17 AM, vandhanaa.r wrote:
> When i click on it , nothing happens , just the page gets refreshed in
> runtime. But it works fine in Viewer.
>
> Does it has anything to do with handling the gethttpRequest in the
> beforeFactory() method ?
>
>
|
|
|
|
Re: Table Sorting [message #735070 is a reply to message #734980] |
Mon, 10 October 2011 20:27 |
|
Did you print out the url?
Jason
On 10/10/2011 11:01 AM, vandhanaa.r wrote:
> Jason,
> I tried debug the before factory() , i did not get any errors.
|
|
|
Powered by
FUDForum. Page generated in 0.04678 seconds