+ # prepare xls Excel Workbook
+ if (defined $xls_fh)
+ {
+
+ # Create a new Excel workbook
+ $workbook = Spreadsheet::WriteExcel->new($xls_fh);
+
+ # Add worksheets
+ $ws_global = $workbook->addworksheet('Exim Statistik');
+ # show $ws_global as initial sheet
+ $ws_global->set_first_sheet();
+ $ws_global->activate();
+
+ if ($show_relay) {
+ $ws_relayed = $workbook->addworksheet('Relayed Messages');
+ $ws_relayed->set_column(1, 2, 80);
+ }
+ if ($topcount) {
+ $ws_top50 = $workbook->addworksheet('Deliveries');
+ }
+ if ($show_errors) {
+ $ws_errors = $workbook->addworksheet('Errors');
+ }
+
+
+ # set column widths
+ $ws_global->set_column(0, 2, 20); # Columns B-D width set to 30
+ $ws_global->set_column(3, 3, 15); # Columns B-D width set to 30
+ $ws_global->set_column(4, 4, 25); # Columns B-D width set to 30
+
+ # Define Formats
+ $f_default = $workbook->add_format();
+
+ $f_header1 = $workbook->add_format();
+ $f_header1->set_bold();
+ #$f_header1->set_color('red');
+ $f_header1->set_size('15');
+ $f_header1->set_valign();
+ # $f_header1->set_align('center');
+ # $ws_global->write($row++, 2, "Testing Headers 1", $f_header1);
+
+ $f_header2 = $workbook->add_format();
+ $f_header2->set_bold();
+ $f_header2->set_size('12');
+ $f_header2->set_valign();
+ # $ws_global->write($row++, 2, "Testing Headers 2", $f_header2);
+
+ $f_percent = $workbook->add_format();
+ $f_percent->set_num_format('0.0%');
+
+ $f_headertab = $workbook->add_format();
+ $f_headertab->set_bold();
+ $f_headertab->set_valign();
+ # $ws_global->write($row++, 2, "Testing Headers tab", $f_headertab);
+
+ }
+