HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //usr/share/doc/libspreadsheet-writeexcel-perl/examples/stats_ext.pl
#!/usr/bin/perl -w

###############################################################################
#
# Example of formatting using the Spreadsheet::WriteExcel module
#
# This is a simple example of how to use functions that reference cells in
# other worksheets within the same workbook.
#
# reverse('©'), March 2001, John McNamara, jmcnamara@cpan.org
#

use strict;
use Spreadsheet::WriteExcel;

# Create a new workbook and add a worksheet
my $workbook  = Spreadsheet::WriteExcel->new("stats_ext.xls");
my $worksheet1 = $workbook->add_worksheet('Test results');
my $worksheet2 = $workbook->add_worksheet('Data');

# Set the column width for columns 1
$worksheet1->set_column('A:A', 20);


# Create a format for the headings
my $heading = $workbook->add_format();
$heading->set_bold();

# Create a numerical format
my $numformat = $workbook->add_format();
$numformat->set_num_format('0.00');




# Write some statistical functions
$worksheet1->write('A1', 'Count', $heading);
$worksheet1->write('B1', '=COUNT(Data!B2:B9)');

$worksheet1->write('A2', 'Sum', $heading);
$worksheet1->write('B2', '=SUM(Data!B2:B9)');

$worksheet1->write('A3', 'Average', $heading);
$worksheet1->write('B3', '=AVERAGE(Data!B2:B9)');

$worksheet1->write('A4', 'Min', $heading);
$worksheet1->write('B4', '=MIN(Data!B2:B9)');

$worksheet1->write('A5', 'Max', $heading);
$worksheet1->write('B5', '=MAX(Data!B2:B9)');

$worksheet1->write('A6', 'Standard Deviation', $heading);
$worksheet1->write('B6', '=STDEV(Data!B2:B9)');

$worksheet1->write('A7', 'Kurtosis', $heading);
$worksheet1->write('B7', '=KURT(Data!B2:B9)');


# Write the sample data
$worksheet2->write('A1', 'Sample', $heading);
$worksheet2->write('A2', 1);
$worksheet2->write('A3', 2);
$worksheet2->write('A4', 3);
$worksheet2->write('A5', 4);
$worksheet2->write('A6', 5);
$worksheet2->write('A7', 6);
$worksheet2->write('A8', 7);
$worksheet2->write('A9', 8);

$worksheet2->write('B1', 'Length', $heading);
$worksheet2->write('B2', 25.4, $numformat);
$worksheet2->write('B3', 25.4, $numformat);
$worksheet2->write('B4', 24.8, $numformat);
$worksheet2->write('B5', 25.0, $numformat);
$worksheet2->write('B6', 25.3, $numformat);
$worksheet2->write('B7', 24.9, $numformat);
$worksheet2->write('B8', 25.2, $numformat);
$worksheet2->write('B9', 24.8, $numformat);