groovy - Trying to setCellValue on blank cell -


i trying insert text blank cell

getrow( 0 ).getcell( 0 ).setcellvalue( 'hat selection' )  

and keep getting

cannot invoke method setcellvalue() on null object

why can't insert text blank cell? how can i?

in case of object null, should first create , should set value on that. use createrow if have not created row already.

sheet.createrow(0); 

if have created row, not respective cell first create respective cell , put desired value. use

sheet.getrow(0).createcell(0).setcellvalue(value); 

or can combine all

sheet.createrow(0).createcell(0).setcellvalue(value); 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -