Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Sorting from header column and getHTTPRequest
SDagenais
Hi everyone,
I've been banging my head on the walls for a couple of days (searching, reading, trying, testing and almost crying ! ) so here i am asking for help !
I'm using BIRT 2.1.2 with MAXIMO 7 application and i'm trying to perform an example that i've seen from IBM about sorting from a header column. From my BIRT Designer, it works fine but when i deploy it on the server, it does not work. I do have errors about getHttpServletRequest().
This is what the code looks like and it is in the initialize method of the script tab :
dataSetName = "dataSet";
sortCol = reportContext.getHttpServletRequest().getParameter("sortCol");
sortDir = reportContext.getHttpServletRequest().getParameter("sortDir");
currentURL = reportContext.getHttpServletRequest().getRequestURL() + "?" +
reportContext.getHttpServletRequest().getQueryString();
sortClause = "";
targetURL = "";
abbrSortCol = "";
if (sortDir != null)
{
if (sortDir.indexOf("ASC") != -1)
sortDir = "DESC";
else
sortDir = "ASC";
}
else
sortDir = "ASC";
if (sortCol != null && sortCol.length != 0)
{
sortClause = " ORDER BY " + sortCol + " " + sortDir;
lastIndex = sortCol.lastIndexOf(".");
if (lastIndex == -1)
abbrSortCol = sortCol;
else
abbrSortCol = sortCol.substring(lastIndex + 1);
}
reportContext.getReportRunnable().getDesignInstance().
getDataSet(dataSetName).queryText += sortClause;
if (currentURL.indexOf("__sorting=") != -1 )
targetURL = currentURL.substring(0, currentURL.indexOf("__sorting") - 1);
else
targetURL = currentURL;
Any help would be appreciated.
Thanks,
Stephane
Find more posts tagged with
Comments
There are no comments yet