Page 1 of 1
					
				Reports Aren't Sorting Correctly
				Posted: Sun Jan 08, 2023 3:50 am
				by DatabaseNewbie
				I have a query that is sorted according to Course Major, Last Name, and then First Name. I'm trying to produce a report utilizing this same sorting (which would put Biology first).
Wizard let me choose Major as the first sort, followed by Last Name and First Name. However, when I finish the report, it only sorts it by Last Name. The Majors are not in order (History is first). 
I tried to find an option to do it in SQL view, but I don't even see a button for that. 
Does anyone know how to troubleshoot this?
			 
			
					
				
				Posted: Sun Jan 08, 2023 9:16 am
				by erbsenzahl
				I used the built-in database biblio and made a query using sorting (wizard). In SQL view I get this:
Code: Select all
SELECT "biblio"."Author" "Author", "biblio"."Booktitle" "Booktitle", "biblio"."Publisher" "Publisher" FROM "biblio" "biblio" ORDER BY "Author", "Booktitle", "Publisher"
ORDER BY. Can this help?
 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Mon Jan 09, 2023 8:10 pm
				by DatabaseNewbie
				So, I am already using the ORDER BY function for my query. My problem is that when I generate a report and use sorting, the report does not reflect the sorting requirements I placed on it. 
The report results should be sorted in the same order as my query, but they're not.
			 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Mon Jan 09, 2023 10:39 pm
				by Villeroy
				What makes you believe that anything is not sorted properly?
Is it not sorted at all? (compared to the source table)
Is ist sorted in strange ways? (alphabetically instead of numeric sort order)
Do you know how to create a query with sorting and then create a report based on that query? (opposed to reporting a table)
			 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Mon Jan 09, 2023 11:00 pm
				by DatabaseNewbie
				Yes, my query is sorted just fine (Majors are in alphabetical order), but my report results are not. I chose the first sorting type to be by Major, but it's not sorting them alphabetically when I finish the report.
			 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Mon Jan 09, 2023 11:10 pm
				by Villeroy
				First of all, which type of database are we talking about? What is the text displayed in the status bar of your Base window? See also menu:Edit>Database>Properties...
Right-click the icon of the correctly sorted query, choose "Report wizard" and create a quick and dirty 2-click report. Ist this report sorted properly?
			 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Mon Jan 09, 2023 11:29 pm
				by DatabaseNewbie
				It is a simple database I created with only 3 tables, 3 queries, and 1 report. According to the properties, it's embedded. Hopefully, this is the info you are needing.
No, even when I use the Report Wizard, it does not sort it in alphabetical order by Major, even though that's the option I choose as my first sort. I've tried sorting in both ascending and descending order, but it keeps sorting the same. It seems to be completely ignoring the Major sort and moving right on to the Last name sort. I even tried sorting only by Major, but again it doesn't put them in alphabetical order.
			 
			
					
				Re: Reports Aren't Sorting Correctly
				Posted: Tue Jan 10, 2023 12:49 am
				by UnklDonald418
				I too have experienced sorting issues with the OO report writer when using a query as the data source. 
Right click on your query and select the 
Create as View option.  A view makes the query look like a table to the Base front end. 
Using the view as a data source and not specifying any sorting in the report, it should print in the order specified in the query.
A better solution is to download and install the Oracle Report Builder Extension.  
https://extensions.openoffice.org/en/pr ... rt-builder
It will print correctly using the query as a data source.