Jump to content
  • Sort By Field


    dnvsrikanth
    Assigned User teodord
    CategoryFeature request
    PriorityNormal
    ReproducibilityAlways
    ResolutionFixed
    SeverityCritical
    StatusResolved

    Sir,

     

    I think if the feature of "Sort By column header" is added in JasperReports, it would be easy to implement dynamic sorting using JasperReports API itself. Currently we are implementin sorting by passing a sort parameter to the Java class that compiles and fills the report which is complex and tedious task.

     

     

     

     

     



    User Feedback

    Recommended Comments

    Hi,

     

    OK, let\'s talk a little about it, especially since you mentioned you are already dealing with dynamic sorting in your application.

     

    You probably know by now that sorting is tight to grouping. If you do not sort according to group structure, you end up with a complete mess.

    So you agree that with sorting you can only deal with the sorting of records in the most inner group and/or with sort direction (asc / desc) of the existing groups.

     

    Let\'s take an example: we have a report displaying orders by country, so we have a country group.

    When we sort this report, we MUST first sort by country. If not, then you end up having the France group all over the place, not only once.

    Our dynamic sorting can only do this:

    1. change the order of countries: asc or desc, knowing that we must order by country no matter what we do;

    2. change the sort order of records inside a country group;

     

    Now my questions are:

    a) for point #2, would you allow people to sort by an expression? Or only by data source fields, like it is the case today with our tags in JRXML?

    b) what kind of dynamic sorting structure would you put in place, knowing that some of the criteria are fixed and others can be dynamic?

     

    Thank you,

    Teodor

     

    Link to comment
    Share on other sites

    Sir

     

    First of all thanks for considering my request. Coming to questions you have asked:

     

    Q1. Inside a group we would order by data source fields only.

     

    Q2. Even let the criteria be dynamic. The user will try to retieve minimum of one field irrespective of the dynamic criteria. So after getting the field(s) in the dataset we can apply sorting on those fields right???

     

    Sorry if I am confusing you,

    DNV Srikanth

     

     

    Link to comment
    Share on other sites

    Sir,

     

     

    Can anyone please update me in this regard...Please inform me whether this is being implemented or not. If its being implemented, when I can expect the release with the change as I have these requiremets to be fulfilled in my project.

     

    Thanks,

    DNV Srikanth.

     

     

    Link to comment
    Share on other sites

    Gentlemen,

     

    Just a comment: sorting in the real world applications might assume different criteria like internal value, textual (formatted) representation of internal value, data stream index, frequency, etc. Both multiplied on choice of ascending/descending direction. So I agree with Teodor, sorting is not so easy as might be. I have had a chance to see a working example where sorting is performed within application layer; presentation layer based on JasperReports receives sorted columns and it finally looks like perfect solution.

     

    Thanks

    Link to comment
    Share on other sites

    Hi Techies,

     

    Thanks for continuing further discussion on this.

     

    I too agree that its not so easy to achieve. But when we add this feature to the JasperReports it would become one of the feathers which will help JasperReports Team to stood ahead of all other reporting softwares that were competing with JR.

     

    In this world nothing can be impossible to achieve. Lets contribute our thoughts and ideas to overcome this challenge.

     

    Thanks,

    DNV Srikanth

    Link to comment
    Share on other sites

    Hi,

     

    I think this was solved in JR 3.7.5 with the introduction of dynamic sorting with SORT_FIELDS build-in parameter and sorting on report variables.

     

    Thanks,

    Teodor

    Link to comment
    Share on other sites

    Changed Status from Feedback Requested to Resolved


    Hi,JR nowadays supports interactive sorting in tables and crosstabs, as long as you are deploying them with JasperReports Server or you implement an interactive report viewer in your web application, similar to how we did it in the /demo/samples/webapp-repo sample shipped with the JR distro.I hope this helps.Teodor
    Link to comment
    Share on other sites



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...