Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Record not getting properly displayed in excel through java code

 
juanschodiger jha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FoodCoupon cr_details = new FoodCoupon();
String company = request.getParameter("report");
allData = cr_details.getEmployees(pageContext,company);

int count=0;
count = allData.size();
int rowno = count/10;

if(allData.size()>0)
{
out.write("<table width=100% border=1 cellpadding=1 cellspacing=1>");
out.write("<tr>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"EMPLOYEE_ID"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"CARD_NUMBER"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"PAYROLL_CITY"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"PAYROLL_LOCATION"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"CURRENT_CITY"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"CURRENT_LOCATION"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"WAGETYPE"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"VENDOR"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"AMOUNT"+"</font></td>");
out.write("<td bgcolor= #3366CC><font color=#FFFFFF>"+"DATE OF JOINING"+"</font></td>");
out.write("</table >");
out.write("<table width=100% border=1 cellpadding=1 cellspacing=1 >");

for (int counter=0;counter<rowno;counter++)
{
out.write("<tr>");
for (int i =0; i<10;i++)
{
out.write("<td>");
out.write(allData.get(counter*10+i).toString());
out.write("</td>");
}
out.write("</tr>");
}
out.write("</table>");


}


All records are not properly getting diaplayed in excel.After 6757 records nothing is getting dispalyed.
Please suggest how to resolve this error.Thank you.
attachment.JPG
[Thumbnail for attachment.JPG]
Excel generated
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this code in a JSP?
 
juanschodiger jha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes above code is in jsp page...........i m not finding any reason why there is a split..
 
nagi ponnaganti
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm really not sure what you are trying to do.. are you trying to display a table on the JSP page and after that copy all the data from the browser to paste it in excel?
if you want to create an xls from the data you have, you should probably go for apache poi jar where you would have more control on formatting cells.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should be no Java code in a JSP. Please read this JspFaq entry.

In particular, putting HTML inside Java inside a JSP is ludicrous! The whole purpose of JSP is so that the HTML markup can be part of the template text.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic