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 the Column Header
hmca
i develop report using POJO and Scripted Data Source.
Can anyone help me how to do sorting in the Column Header(ASC/DESC) of Scripted DataSet? or Is it not possible for Scripted Data Source?
Thanks in Advance.
Find more posts tagged with
Comments
CBR
You could simply apply the formatting on the table that prints out the records of your dataset. Once you got a table that is bound to the dataset, click that table on switch to the Sorting Tab in the Property Editor view. You can add multiple sorting conditions over there. The sort will be applied to the dataset just before it creates that table.
If your dataset needs to be printed out multiple times (using 2 tables) the sorting needs to be applied on both tables.
hmca
hai cbrell,
thanks for reply..
Now its working fine.And also my requirement is ,do sorting dynamically by clicking the column header in the report (ASC--> DESC, DESC--> ASC). Is it possible for Scripted DataSet ? Please suggest me
Snehu
I have the same requirement as above. If anyone knows. Kindly guide us.
kclark
Snehu <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1308-grouping-and-table-sorting-using-de-api/'>here's
a devshare</a> that shows how to sort a table with scripting. Look in the beforeFactory() <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
delm = reportContext.getDesignHandle().findElement("mytable");
tgh = delm.getGroups().get(0);
tgh.setSortDirection(params["sortorder"].value);
</pre>
<br />
If you need to sort them dynamically you could use a drill to details approach to pass the value of what was clicked to a hidden parameter and sort with the same code.
Snehu
Thanks for reply kclark.
I am using JDBC data sourse. I have created 1 report parameter named Proname which is hidden and of boolean type. Default value is true.
Then in table i have created a hyperlink at coulmn header. with drill down approach. its expression is:
if(params["ProName"].value==true){
params["ProName"].value=false;
}
else{
params["ProName"].value = true;
}
It works fine for one coulmn. but when I tried for more than 1 coulmn in that table it is not accepting it.
I understand what you are saying. I have to get what is clicked by a hidden parameter in script and just pass it to the method.
I m trying for that. It will be really helpful, if you guide me to achieve this. I will be greatful to you.
sachindhus
Please refer this link
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1590-dynamic-column-sorting/