• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Apache POI :Export to xls(Coloured Cell) not working in MS Excel

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
0 down vote favorite
share [g+] share [fb] share [tw]


I am working on the export functionality in the Apache POI. The "Export to xls" colour functionality is not working in the MS Excel where as it is working in the Open Office.

I am trying to export using the ServletOutputStream and accordingly trying to get the desired "Coloured Cell" on the Excel Sheet.

The coloured cell is being shown in the Open Office but is not being shown in the MS Excel.

Code Which i am using for writing a file:--

response.setContentType("application/xls");
response.setContentLength( myWorkBook.getBytes().length);
response.setHeader("Content-Disposition", "attachment;filename=Report.xls");
response.getOutputStream().write( myWorkBook.getBytes(), 0, myWorkBook.getBytes().length);
response.getOutputStream().flush();
response.getOutputStream().close();

Please Help
 
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites: http://stackoverflow.com/questions/9079391/apache-poi-export-to-xls-not-working-in-ms-excel
 
Vishu Singhvi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am generating the file and finally got the help.
Using "OutputStream" class we have write the file o=into the "HSSFWorkbook" and now its working fine. Thanks for the replies
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic