Bugfix: Default SQLReport output columns randomly ordered

This commit is contained in:
Len Kranendonk 2004-10-12 07:48:06 +00:00
parent ba1525d091
commit d3a8d76aa5
3 changed files with 21 additions and 1 deletions

View file

@ -193,6 +193,21 @@ sub getBarTraditional {
}
#-------------------------------------------------------------------
=head2 getColumnNames ( )
Returns an array containing the column names
=cut
sub getColumnNames {
if(ref $_[0]->{_columnNames} eq 'ARRAY') {
return @{$_[0]->{_columnNames}};
}
}
#-------------------------------------------------------------------
=head2 getFirstPageLink ( )
@ -493,6 +508,7 @@ sub setDataByQuery {
$sth = WebGUI::SQL->read($sql,$dbh);
}
$self->{_totalRows} = $sth->rows;
$self->{_columnNames} = [ $sth->getColumnNames ];
my $pageCount = 1;
while (my $data = $sth->hashRef) {
$rowCount++;