Thread Spreadsheet::WriteExcel: neues Sheet nach X Zeilen oder Trennzeic (5 answers)
Opened by mumu2000 at 2005-04-25 17:58

GwenDragon
 2005-04-25 18:07
#4878 #4878
User since
2005-01-17
14748 Artikel
Admin1
[Homepage]
user image
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
set_v_pagebreaks(@breaks)

Add vertical page breaks to a worksheet. A page break causes all the data that follows it to be printed on the next page. Vertical page breaks act between columns. To create a page break between columns 20 and 21 you must specify the break at column 21. However in zero index notation this is actually column 20. So you can pretend for a small while that you are using 1 index notation:

   $worksheet1->set_v_pagebreaks(20); # Break between column 20 and 21

The set_v_pagebreaks() method will accept a list of page breaks and you can call it more than once:

   $worksheet2->set_v_pagebreaks( 20,  40,  60,  80, 100); # Add breaks
   $worksheet2->set_v_pagebreaks(120, 140, 160, 180, 200); # Add some more

Note: If you specify the ``fit to page'' option via the fit_to_pages() method it will override all manual page breaks.


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
my($frage, $antwort) = @$e; 
         
          # Eintrag schreiben
     
#----------     So könnte es gehen! ------------
      if ($frage =~ /^###BREAK###/) {
         set_v_pagebreaks( $row++ );
         next;
      }
#----------

      $sheet->write($row, 2*$col,
                   "$frage - $antwort");
\n\n

<!--EDIT|GwenDragon|1114438444-->

View full thread Spreadsheet::WriteExcel: neues Sheet nach X Zeilen oder Trennzeic