pathfinder2104.work Posted March 7, 2014 Share Posted March 7, 2014 Hi,I have created a report using a student table students have their priority to be treated in ascending order, Now my sql query works find on the database side but when I try to fire the same query from jasper report it doesn't give me the same result. I also tried to set up the sorting using the field value but it didn't work. I am using Jasper studio 5.5.1 final. Link to comment Share on other sites More sharing options...
hozawa Posted March 7, 2014 Share Posted March 7, 2014 Kind of difficult to reply because you haven't specified which database you're using and your sql statement. Link to comment Share on other sites More sharing options...
fcerbell Posted March 7, 2014 Share Posted March 7, 2014 Hi,The dataset sort feature is useful when the query language does not support the kind of sorting that you want to achieve.If you get a list of cities from a SQL database and you want to sort them on their population fetched from a webservice, for example. It can also be because you want to sort and the query language does not allow sorting at all.It your case, did you try to add an ORDER BY statement to your SQL query ? Did your qery returned what you expected when you ask to preview the data (the tab at the bottom of the query dialog) ?RegardsFrançois Link to comment Share on other sites More sharing options...
pathfinder2104.work Posted March 10, 2014 Author Share Posted March 10, 2014 I have used the dataset sorting feature using the same field, it didn't work. I am already using the ORDER BY in my query. I can see the desired output in my query browser. I have checked the data preview but no data is visible in there however for the same set of parameters I can see data in report and in query browser too. Link to comment Share on other sites More sharing options...
Solution pathfinder2104.work Posted March 12, 2014 Author Solution Share Posted March 12, 2014 Something was wrong on my end. I was placing the List element in the details band and hence the same set of data was being repeated all over many pages. I found it out when I created the jrxml for same report again ..... :) :) Thank you for your efforts in reading and answering this question. Especially fcerbell ... :) :) Link to comment Share on other sites More sharing options...
hmurillop Posted August 11, 2014 Share Posted August 11, 2014 My solution for this problem.In this case i have 2 parameters, both are from prompt and class java.util.date:start_date ( default value = DATE(2014,01,01) ) end_date ( default value = new java.util.Date() )And i have this "conditional" in my query SELECT...FROM...WHERE "here your date data column" BETWEEN CONVERT( DATE, $P{start_date} ) AND convert(varchar(25),convert(date,$P{end_date }) ) + ' 23:59' Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now