how to get MS EXCEL formulas in Java Script

Discussion in 'Javascript' started by Yousaf, Apr 9, 2007.

  1. Yousaf

    Yousaf Guest

    How can i get MS Excel like formulas in Java Script , so that my
    webpage controls get updated when their value changes based on the
    formula specified.
     
    Yousaf, Apr 9, 2007
    #1
    1. Advertising

  2. Yousaf wrote:

    > How can i get MS Excel like formulas in Java Script
    > so that my webpage controls get updated when their
    > value changes based on the formula specified.


    You could use Excel's formula notation in the base code and the
    calculations auto-update:

    <object classid="CLSID:0002E510-0000-0000-C000-000000000046"
    id="obj">
    <param name="HTMLData" value="&lt;table&gt;
    &lt;tr&gt;
    &lt;td&gt;26&lt;/td&gt;
    &lt;td&gt;4&lt;/td&gt;
    &lt;td&gt;6&lt;/td&gt;
    &lt;td&gt;=(A1+B1)/C1&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;">
    </object>

    To update a formula, here e.g. from '(A1+B1)/C1' to 'A1-B1':

    <script type="text/javascript">
    obj.HTMLData =
    '<table><tr><td>26</td><td>4</td><td>6</td><td>=A1-B1</td></tr></
    table>'
    </script>

    Hope this helps,

    --
    Bart
     
    Bart Van der Donck, Apr 10, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. microsoft.private.windows.netserver.setup

    Evaluating Formulas in ASP.NET

    microsoft.private.windows.netserver.setup, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    390
    Steve C. Orr [MVP, MCSD]
    Mar 4, 2004
  2. Kevin Howe
    Replies:
    6
    Views:
    248
    Kevin Howe
    Feb 6, 2005
  3.  James
    Replies:
    0
    Views:
    182
    James
    May 19, 2011
  4. Will James
    Replies:
    22
    Views:
    689
    Will James
    May 26, 2011
  5. qazmlp
    Replies:
    2
    Views:
    154
    Ben Morrow
    Nov 17, 2004
Loading...

Share This Page