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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -