View | Details | Raw Unified | Return to bug 12622
Collapse All | Expand All

(-)a/reports/guided_reports.pl (-5 / +7 lines)
Lines 814-821 elsif ($phase eq 'Export'){ Link Here
814
                my $table = $doc->getTable(0);
814
                my $table = $doc->getTable(0);
815
                my @headers = header_cell_values( $sth );
815
                my @headers = header_cell_values( $sth );
816
                my $rows = $sth->fetchall_arrayref();
816
                my $rows = $sth->fetchall_arrayref();
817
                my ( $nb_rows, $nb_cols ) = ( scalar(@$rows), scalar(@{$rows->[0]}) );
817
                my ( $nb_rows, $nb_cols ) = ( 0, 0 );
818
                $doc->expandTable( $table, $nb_rows, $nb_cols );
818
                $nb_rows = @$rows;
819
                $nb_cols = @headers;
820
                $doc->expandTable( $table, $nb_rows + 1, $nb_cols );
819
821
820
                my $row = $doc->getRow( $table, 0 );
822
                my $row = $doc->getRow( $table, 0 );
821
                my $j = 0;
823
                my $j = 0;
Lines 823-835 elsif ($phase eq 'Export'){ Link Here
823
                    $doc->cellValue( $row, $j, $header );
825
                    $doc->cellValue( $row, $j, $header );
824
                    $j++;
826
                    $j++;
825
                }
827
                }
826
                for ( my $i = 1; $i < $nb_rows +1 ; $i++ ) {
828
                my $i = 1;
829
                for ( @$rows ) {
827
                    $row = $doc->getRow( $table, $i );
830
                    $row = $doc->getRow( $table, $i );
828
                    for ( my $j = 0 ; $j < $nb_cols ; $j++ ) {
831
                    for ( my $j = 0 ; $j < $nb_cols ; $j++ ) {
829
                        # FIXME Bug 11944
830
                        my $value = Encode::encode( 'UTF8', $rows->[$i - 1][$j] );
832
                        my $value = Encode::encode( 'UTF8', $rows->[$i - 1][$j] );
831
                        $doc->cellValue( $row, $j, $value );
833
                        $doc->cellValue( $row, $j, $value );
832
                    }
834
                    }
835
                    $i++;
833
                }
836
                }
834
                $doc->save();
837
                $doc->save();
835
                binmode(STDOUT);
838
                binmode(STDOUT);
836
- 

Return to bug 12622