View Single Post
 
Old April 16th, 2015, 02:22 AM
guzz70 guzz70 is offline
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2015
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP to Excel with formulas and different language versions

Hi

I am am trying to export a table created in HTML/Classic ASP to Excel, and with some help from the net I've managed to get almost to the end; see below.

However, I have a couple of obstacles that I need to pass.

How do I handle the Excel formulas in different languages? I am using an Excel with formulas in Swedish language, but obviously I cannot be sure my webpage users will all use the obscure Swedish Excel. Is there like a universal setup of Excel-formulas that will work in any language version? Or is there any other way around this dilemma?

Example: English formula "SUM" in Swedish is "SUMMA"

Also, every time I open up the file I get an error message saying that the file is not compatible with the file type. However the file opens fine. Would be nice to get rid of the errormessage though. How do I get rid of the error message?



<%@ Language=VBScript %>
<% option explicit
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", "attachment; filename=exceltest.xls"
%>
<HEAD>
<STYLE>
TD.excel_tabletop {
background-color:#EEEEEE;
border-bottom-width:1px;
border-bottom-style:solid;
font-weight : bold;}

TD.excel_tablenormal {
font-weight : normal;
mso-number-format : 0\.0;}

TD.excel_tablebottom {
border-top-width:1px;
border-top-style:solid;
font-weight : bold;
mso-number-format : 0\.0;}

</STYLE>

</HEAD>
<table>
<tr>
<TD CLASS='excel_tabletop'>&nbsp;</TD>
<TD CLASS='excel_tabletop'>Mon</TD>
<TD CLASS='excel_tabletop'>Tue</TD>
<TD CLASS='excel_tabletop'>Wed</TD>
<TD CLASS='excel_tabletop'>Thu</TD>
<TD CLASS='excel_tabletop'>Fri</TD>

</tr>
<tr>
<td CLASS='excel_tablenormal'>Week 1</td>
<td CLASS='excel_tablenormal'>5,3</td>
<td CLASS='excel_tablenormal'>7,9</td>
<td CLASS='excel_tablenormal'>8,2</td>
<td CLASS='excel_tablenormal'>-4,3</td>
<td CLASS='excel_tablenormal'>3</td>
</tr>

<tr>
<td CLASS='excel_tablenormal'>Week 2</td>
<td CLASS='excel_tablenormal'>3,3</td>
<td CLASS='excel_tablenormal'>7,2</td>
<td CLASS='excel_tablenormal'>8</td>
<td CLASS='excel_tablenormal'>-5,3</td>
<td CLASS='excel_tablenormal'>3,9</td>
</tr>

<tr>
<td CLASS='excel_tablenormal'>Week 3</td>
<td CLASS='excel_tablenormal'>4,3</td>
<td CLASS='excel_tablenormal'>5,9</td>
<td CLASS='excel_tablenormal'>8,6</td>
<td CLASS='excel_tablenormal'>4,3</td>
<td CLASS='excel_tablenormal'>-6,2</td>
</tr>

<tr>
<td CLASS='excel_tablebottom'>Total</td>
<td CLASS='excel_tablebottom'>=SUMMA(B2:B4)</td>
<td CLASS='excel_tablebottom'>=SUMMA(C2:C4)</td>
<td CLASS='excel_tablebottom'>=SUMMA(D2:D4)</td>
<td CLASS='excel_tablebottom'>=SUMMA(E2:E4)</td>
<td CLASS='excel_tablebottom'>=SUMMA(F2:F4)</td>
</tr>

</table>

Last edited by guzz70; April 16th, 2015 at 04:05 AM..