Sunday, 15 January 2012

java - Inserting multiple data into an excel sheet at a time using JXL -



java - Inserting multiple data into an excel sheet at a time using JXL -

i have scenario have insert multiple lines of info excel sheet. using jxl api purpose. problem that, lastly set of info in loop beingness written in excel sheet. can please help me in achieving or provide code snippet or example?

thanks lot.

int ccount = ws.getcolumns(); int rc = ws.getrows(); int rnum = rc - 10; for(int i=1;i(lesser symbol)3; i++){ rnum++; string srnum = string.valueof(rnum); wsheet.addcell(new jxl.write.label(1, rc, srnum, wcf1)); wsheet.addcell(new jxl.write.label(2, rc, "b", wcf1)); wsheet.addcell(new jxl.write.label(3, rc, "c", wcf1)); wsheet.addcell(new jxl.write.label(4, rc, "d", wcf1)); system.out.println("executing..........."); wsheet.addcell(new jxl.write.label(5, rc, "e", wcf1)); wsheet.addcell(new jxl.write.label(6, rc, "f", wcf1)); wb.write(); rc++; }

here, wcf1 refers writablecellformat have defined in method. in sheet, have inserted info till row number 11 , need insert multiple info after that. used loop. not giving result properly. please help me out this.

i can't inquire more detail straight (low rep) on question. write output obtain?

i'm not sure ws.getrows() work correctly. have printed out value of rc?

following code obtain like

|a |b |c |d |e |f | ...|....|...|...|...|...|...| x |bla |bla|bla|bla|bla|bla| x+1|x-10|b |c |d |e |f | x+2|x-9 |b |c |d |e |f |

java excel jxl

No comments:

Post a Comment