[ajug-members] how to enable or provide a web report in excel

Berlin Brown bbrown at khafra.com
Thu Jun 10 10:04:07 EDT 2004


For example from a servlet, you can use the appropriate mime-type

 response.setContentType("application/vnd.ms-excel");
 PrintWriter out = response.getWriter();

and then output the data as an html 'table' and the Excel application will launch.

This is the way I have done it, you may also consider using CSV, which is also handled by excel.

  out.println("<html>");
  out.println("<body>");

   out.println("<table BORDER=\"1\" align=\"center\">");
   out.println("<tr>");
    out.println("<td colspan=4><b>Error Report(Missing PIPEIDs)</b>");
    out.println("</td>");
   out.println("</tr>");
   out.println("<tr>");
   out.println("<td>MHNO</td>");
   out.println("<td>NEWMHNO</td>");
   out.println("<td>NORTHING</td>");
   out.println("<td>EASTING</td>");
   out.println("<td>RIM</td>");
   out.println("<td>REACH</td>");
   out.println("<td>DSMHNO</td>");
   out.println("<td>MHINV</td>");
   out.println("<td>INV1</td>");
   out.println("<td>INV2</td>");
   out.println("<td>LENGTH</td>");
   out.println("<td>DIA_IN</td>");
   out.println("<td>DIA_FT</td>");
   out.println("<td>MANNING</td>");
   out.println("<td>CONDUITTYPE</td>");
   out.println("</tr>");

  ----- Original Message ----- 
  From: dave wible 
  To: ajug-members at ajug.org 
  Sent: Thursday, June 10, 2004 9:44 AM
  Subject: [ajug-members] how to enable or provide a web report in excel


  I have a need to allow users to take a web-based report and offer an excel alternative.  The user would click on a link and in a browser, probably, their data would appear in little excel spreadsheet grids.

  Any ideas? The current implementation is using some xml/xsl transformation.  I'm not even familiar with it but i'm looking for alternatives.

  thanks


------------------------------------------------------------------------------


  _______________________________________________
  ajug-members mailing list
  ajug-members at ajug.org
  http://www.ajug.org/mailman/listinfo/ajug-members
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ajug.org/pipermail/ajug-members/attachments/20040610/3e8b64e1/attachment.html 


More information about the ajug-members mailing list