Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help for this Problem in creating excel sheet using java

 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am creating an excel file with my java code.

Here is the code




This should create 20 cells in the excel sheet but its not working properly


Please help....
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does "it's not working properly mean"? What, exactly, does happen? Seeing an SSCCE would help.
 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

The statement at line 10 is displaying

3.41
5.55
4.79
1.92
1.86
2.68
1.24
1.21
1.54
1.53
1.59
1.5
1.27
1.28
1.34
1.89
3.56
1.33
2.9

but these values are not getting published in excel sheet

In excel sheet i am getting these values at row 1

2.9 3.55 1.26 1.27 1.34 2.68 1.24 1.21 1.52 1.52

 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing an SSCCE it's hard to tell what's going on. What is "s", for example?

Also, what are the for loop and the if statement supposed to do? The while loop already takes care of iterating over all elements of "stk".
 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my complete code





Here is the complete code..........
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what's the output of the stack traces?

Note that the second while loop is pointless, as it will never loop.
 
Ifteqar Ahmed
Ranch Hand
Posts: 85
Java Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,

Thank You very much. My program is working fine after removing that for loop.

Here is the modified code



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic