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 - Unusual behaviour when drawing lots of images onto a large canvas -

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

javascript - Chart.js - setting tooltip z-index -