My apologies !!

Original content (below) and title restored by GrandFather.

Hi,

First here is the related snippet of code I want to ask your assistance for :

my $row=1; while ($a = $sth->fetchrow_hashref()) { $worksheet->write_url($row,0, qq({internal:'$a->{OrderID}'!A1})); $worksheet->write($row,0, $a->{OrderID}, $bold); $worksheet->write($row,1, $a->{OrderDate}); $worksheet->write($row,2, $a->{ShippedDate}); $worksheet->write($row,3, $a->{CustomerName}); $worksheet->write($row,4, $a->{ShipVia}); $worksheet->write($row,5, $a->{ShipName}); $worksheet->write($row,6, $a->{ShipAddress}); $worksheet->write($row,7, $a->{ShipCity}); $worksheet->write($row,8, $a->{ShipRegion}); $worksheet->write($row,9, $a->{ShipPostalCode}); $worksheet->write($row,10, $a->{ShipCountry}); $worksheet->write($row,11, $a->{Freight},$number); $freight = $a->{Freight}; $ordttl = $a->{'Total'} + $a->{'Freight'}; $worksheet->write($row,12,$ordttl,$number); $row++; print "Current row number is $row\n";

After $row++ loop how do I maintain the current $row number so I can add other stuff like grand total to be positioned just after $row++ loop in the same worksheet.

As you can see above I am printing the current $row after $row++ loop and it shows that current row is 2 this is not I want, I want the next row after $row++ loop, I hope I have made my question clear enough.

Many many thanks for your help !!

Terry

In reply to Spreadsheet::WriteExcel how to maintain row number by terrykhatri

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.