www.webdeveloper.com
Results 1 to 5 of 5

Thread: Using Excel in HTML

  1. #1
    Join Date
    Apr 2014
    Posts
    1

    Unhappy Using Excel in HTML

    Hi Webdeveloper users,
    I am very new to web developement and now fairly decent at using basic html coding and CSS'ing. I am pretty weak at javascript and VBScript and have no knowledge of php. I am developing a webpage for my father for a cab company. This company does journeys from airports to many locations around London. How we calculate is from the airport to postcodes around the city.

    To get the price from the site, at first i temporarily used if statements to get price, but its really really long!! and editing prices are a pain! I want to be able to have a table of price on xls and be able to retrieve the price based on the customer's input. Eg,
    the excel would have the following as
    row; Lhr, Lgw, Stn
    Column; HA1, HA2, HA3

    and in between these would be prices. The passengers would select airport from select type menu and another for postcodes. On the next page, i should have page with the price for the selected locations. I have no idea on how about i would be doing this, i hope you will help me..

    Kind Regards,
    Stephen

  2. #2
    Join Date
    Mar 2014
    Location
    UAE
    Posts
    98
    Hey Srephen,
    I just understanding your situation but i m not sure that.. can you make a screen shots and put it here so we can help you

  3. #3
    Join Date
    Mar 2011
    Posts
    1,139
    Only Internet Explorer can really read native Excel files. But you could save your Excel file in '.csv' format and use JavaScript (AJAX) to read it and look up the prices. It will probably take you some time to learn how to parse the .csv file, but you should be able to find examples of how to read a text file in JavaScript using AJAX, and even some examples of parsing a .csv file.
    Rick Trethewey
    Rainbo Design

  4. #4
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    If you want to read Excel files and show them in the browser, you have a few options depending how you want to do it. If you want to use JavaScript, you can use the DHTMLX library. Since it uses jQuery, HTML and CSS, it's compatible across browsers (tested and used it a few times). There's a lot of documentation for it online as well as examples. Here's a live example from their site of how you can load and edit the Excel file in browser. With some PHP, you can save this file.

    An alternative is to use PHP libraries, such as PHPExcel and PHPExcelReader. Even though you said you have no knowledge of PHP, these libraries are written for you, so it's just a matter of specifying the file and using their functions (and they come with examples and documentation).

    The last alternative is to make your life a bit easier in the long run and use a database. If it's not too large right now, you can migrate the information.

    If you really want to use VBA for this, you can by converting everything to a .CSV and writing code to read it or use a library for it. Again, this depends exactly what you want the result to look like, its functionality, any other features, etc... .

  5. #5
    Join Date
    Apr 2014
    Posts
    34
    As others have said, CSVs might be an easier way to go other than Excel files. Could you not use a database in this situation? (it sounds like this would be ideal for looking up results like you would want)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles