This sample shows how you can initialize constants used by the calculator. You will need some basic programmers skills to do this and a suitable web server technology, for example Classic ASP or PHP.

How to initialize values on the server

We have create a simple calculator, and the rate changes all the time. We want to update it without having to regenerate the webpage using SpreadsheetConverter/ExcelEverywhere. This sample can be enhanced so that the constants are read from a database or similar.

  1. Create a spreadsheet and generate the HTM-page using ExcelEverywhere
  2. Move the file to a directory accessable from your web server IIS.
  3. Rename the file from .htm to .asp



  1. Make sure that the webpage still works:



  1. Open the file in notepad, in my case ’notepad c:\inetpub\wwwroot\asp\asp-rate\asp-rate.asp’
  2. Insert the following first in the file:

<%

dim rate

rate = 0.07

%>

  1. Make sure that the page still works by opening http://localhost/asp/asp-rate/asp-rate.asp in a new browser window
  2. Search for ’;var cA2B=(0.05);’ and replace it by ;var cA2B=(<%= rate %>);
  3. Test the new version by opening http://localhost/asp/asp-rate/asp-rate.asp and enter 100 in the first cell. You will get 7.0000 as result.
  4. Notice that the form still says 5%. You will find the text 5% further down in the file. In order to get rid of this presentation of 5%, either hide row 2 or replace ’5’ by <%= rate*100 %> (Keep the %)

The files for this sample

  1. The Excel file: asp-rate.xls
  2. The HTML-file: asp-rate.htm
  3. The ASP-file: asp-rate.asp
  4. The ASP-file as a text file so that you can view it: asp-rate.txt