Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How to get cell format of xls

by bimleshsharma (Beadle)
on May 23, 2012 at 06:49 UTC ( #971959=perlquestion: print w/ replies, xml ) Need Help??
bimleshsharma has asked for the wisdom of the Perl Monks concerning the following question:

I am getting format of cell but i am unknown about the actual properties. Because i have to use same format for other cell if bg_color=red. I am using code below to get format..
# Get the format from the cell my $format = $template->{Worksheet}[$sheet] ->{Cells}[$row][$col] ->{FormatNo};

Comment on How to get cell format of xls
Download Code
Replies are listed 'Best First'.
Re: How to get cell format of xls
by moritz (Cardinal) on May 23, 2012 at 07:11 UTC
Re: How to get cell format of xls
by bimleshsharma (Beadle) on May 23, 2012 at 09:43 UTC
    i am using module as below
    use Spreadsheet::ParseExcel::SaveParser; my $template = $parser->Parse('compare_reports/38_HMI1071_cre_cdo_G.xl +s'); # Get the format from the cell my $worksheet = $template->worksheet($sheet); my $val=$worksheet->get_cell($row,$col)->value()
    I am getting error (Can't call method "value" on an undefined value at)when cell($row,$col) is blank. How to handle blank cell. pls help.
        Ok, i used below but getting error...
        if(undef $worksheet->get_cell($row,$col)){ next; }
        error now i am getting:"Can't modify non-lvalue subroutine call at ."

      Have you tried not calling ->value when ->get_cell() returns undef? What happened when you tried it?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://971959]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (13)
As of 2015-07-31 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls