Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel on ASP (not .Net) IIS web site?

Status
Not open for further replies.

klamerus

Programmer
Jun 23, 2003
71
US
We're looking for a tool, other than Excelwriter, for creating Excel documents on an ASP web site to download to workstations. We can't use XML because we're using older excel on our desktops - and we'd like to use a template (starter) excel document for formatting. We also need pivot table data.

Does anyone know of any other tool that can do this type of thing?

OWC isn't going to handle it and we can't use real Excel. It's got too big a footprint
 
Thanks, but unfortunately, these all exploit the things that we said we can't do.

We really need an alternative product that works with Excel (real excel, not CSV or XML) including excel templates and that can manipulate data used in pivot tables in them.
 
Doesn't Excel Objects work for you? It works for me.
Here's a sample code:
Code:
<HTML>
<HEAD><TITLE>My Excel File Update Demo</TITLE></HEAD>
<BODY>
<%
cellcontent=request.form("cellcontent")
if cellcontent="" then
%>
<form name="frmExcelData" method="post" action="<%=Request("SCRIPT_NAME")%>">
<table>
<tr>
  <td align="right">
    Enter cell data:
  </td>
  <td>
    <input name="cellcontent" maxlength="20" value="<%=cellcontent%>"><br>
  </td>
</tr>
<tr>
  <td align="right">
    Place in cell: 
  </td>
  <td>
    <select name="celladdr">
      <option value="a1">A1</option>
      <option value="a2">A2</option>
      <option value="a3">A3</option>
      <option value="b1">B1</option>
      <option value="b2">B2</option>
      <option value="b3">B3</option>
    </select>               
  </td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td>&nbsp;</td>
<td><input name="OK" type="submit" value="Submit Data">
</tr>
</form>
<script language="JavaScript">
  document.frmExcelData.cellcontent.focus();
</script>
<%
else
  xlfile=server.mappath("Book1.xls")
  set oExcel=createobject("Excel.Application")
  oExcel.Workbooks.Open(xlfile)
  oExcel.Workbooks(1).Sheets(1).Range(request.form("celladdr")).Value = cellcontent
  oExcel.Workbooks(1).Save
  oExcel.Quit
  set oExcel=nothing
%>
Data was successfully written to file <%=xlfile%>
<br><a href="<%=Request("SCRIPT_NAME")%>">Enter another data</a>
<%
end if
%>
</BODY>
</HTML>
To test this, make sure you have an excel file named Book1.xls in the same folder where the ASP file is.
 
The issue isn't whether Excel works or not. It does.

The issue is its footprint. Using Excel on a server under a concurrent load of dozens to hundreds of users all working away and creating Excel documents is a bad idea. It's a resource hog not suited to the purpose. That's why products like Chili and Excelwriter came into being. They're light and nimble. So is OWC, but it's also fairly limited in capabilities.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top