CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Sorting problem again.

Print topic Send  topic

Author Message
Jeff Swanson
Posted: 08/02/2002, 11:08 AM

I have a problem where if I turn on sorting if I have a custom SQL statement with a custom sort in the Open Event, I don't get anything at all in the grid. I have tried several examples from this forum but to no avail. If I remove the custom sort, then everything in the grid shows up in the proper default order(as in what I want to be the default order).


Here is my custom SQL:

SELECT `drivers`.`name`,
`drivers`.`kart_no`,
`classes`.`class_name`,
`rookies`.`yes_no`,
SUM( `race_stats`.`final_points` ) AS total_points
FROM `drivers`
INNER JOIN `race_stats` ON (`drivers`.`racer_id` = `race_stats`.`racer_id`)
INNER JOIN `rookies` ON (`race_stats`.`rookie` = `rookies`.`rookie`)
INNER JOIN `classes` ON (`race_stats`.`class_id` = `classes`.`class_id`)
GROUP BY `drivers`.`name`, `drivers`.`kart_no`, `classes`.`class_name`, `rookies`.`yes_no`
ORDER BY `classes`.`class_name`, 5 DESC


I have turned on sorting and put a in the following custom sort into the Open Event:

$iSort = getparam("FormPoints_Sorting");
IF ($iSort == 1)$sOrder = " ORDER BY class_name";
IF ($iSort == 2)$sOrder = " ORDER BY kart_no";
IF ($iSort == 3)$sOrder = " ORDER BY name";
IF ($iSort == 4)$sOrder = " ORDER BY total_points";
IF ($iSort == 5)$sOrder = " ORDER BY yes_no";
$sSQL .= $sOrder;

What am I doing wrong?
Nicole
Posted: 08/05/2002, 7:25 AM

Jeff,
the code looks correct...
What exactly do you see on the page? Does it happen after you click on column to sort or when page is loading first time?
Jeff Swanson
Posted: 08/05/2002, 7:11 PM

All I get is the column headers. Other than that, the grid is empty. If I turn off sorting, then everything shows up but of course, I can't sort.
Nicole
Posted: 08/06/2002, 7:19 AM

Jeff,
May be it makes sense to contact CC support and email you project to investigate?
Just in case the support link is:
http://support.codecharge.com/support_new.asp

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.