• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Record not getting properly displayed in excel through java code

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this code in a JSP?
 
juanschodiger jha
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes above code is in jsp page...........i m not finding any reason why there is a split..
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
A tiny monkey bit me and I got tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic