Thank you for your help. I have found another problem and then subsequently a solution for the writing vertically in a merged column. The trick is to write what you want to the destination cell and then merge the cells. If you merge them first and then write the data to the beginning cell of the merged column it only registers as being written to that cell and it is treated as though it is in a single cell rather than a merged column. Here is the working code:
#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; # Variables my $file_name = 'switch_report.xls'; my $sheet_title='Traffic Estimations Report -May 2002'; my @array=( ['Switch 1','','above cell blank','456','789'], ['Switch 2','DEF','GHI'] ); #print $1; #my $array_ref=\$1; my $array_ref=\@array; # Create a new Excel workbook my $workbook = Spreadsheet::WriteExcel->new($file_name); # Add a worksheet my $worksheet = $workbook->addworksheet(); $worksheet->fit_to_pages(1,1); $worksheet->set_landscape(); $worksheet->set_margins(.25); # Add formats my $cb_format = $workbook->addformat(); # Add a format my $rotation_format = $workbook->addformat(); # Define Formats # $cb_format $cb_format->set_bold(); $cb_format->set_italic(); $cb_format->set_underline(); $cb_format->set_align('center'); $cb_format->set_size(18); # $rotation_format $rotation_format->set_rotation(2); $rotation_format->set_bold(); $rotation_format->set_align('vcenter'); # Write to the worksheet $worksheet->write(0,1,$sheet_title, $cb_format); $worksheet->merge_cells(0,1,2,29); $worksheet->merge_cells(3,1,3,29); #$worksheet->write_row(11,1,$array_ref); $worksheet->write(4,0,"Day of the month",$rotation_format); $worksheet->merge_cells(4,0,37,0); # write_switch_data my $row = 4; my $col = 1; $worksheet->write_row($row, $col, $array_ref);

In reply to Re: Re: Spreadsheet::WriteExcel, rotate text by gnu@perl
in thread Spreadsheet::WriteExcel, rotate text by gnu@perl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.