where to save exchange rates that are used in a form? - InfoPath Dev
in

InfoPath Dev

where to save exchange rates that are used in a form?

Last post 11-09-2009 09:55 PM by omerkadari. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-07-2007 02:45 PM

    where to save exchange rates that are used in a form?

    Hi,

    I need to impement a form were the user can select from different currencies, whereupon the values in the fields are recalculated depending on the choice.
    concretely:

    a field: specified_price, "specify price:"
    dropdownmenu: currency, "specify currency:" (USD/EUR/CHF etc.)

    an unchangeable field/formula box: price_in_CHF, "price in CHF" 

    so when the currency is changed the "specify price"-field value should be multiplied with a factor to obtain the price in CHF. clearly, those factors (exchange rates) need to be specified somewhere and my question is where/how. I've tried using unchangable data-fields with standard values within the form template, but then wasn't able to implement the calculation. The problem is, I need to have the rates in some kind of repeating data-source form to perform (something like):

    price_in_CHF
    = (exchange_rate where currency_name=currency) * specified_pice ...

    So next, i tried having the exchange rates in an external XML file, which worked, but it is rather troublesome to change the values like this (the xml file needs to be imported anew every time). The rates don't have to be changeable quickly, i was told that they just want to be able to adapt them once or twice a year, so they told me they could do it by changeing something in the infopath-template.

    Anyone got some suggestions how to implement this conveniently?

    Regards,

    Fabian
     

  • 05-07-2007 03:13 PM In reply to

    Re: where to save exchange rates that are used in a form?

    Hi GaAs,

    InfoPath includes an International Expense Report form as a sample, which implements exactly what you are talking about. Maybe you can just modify this example to suit your needs. Check it out!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 05-08-2007 05:16 AM In reply to

    Re: where to save exchange rates that are used in a form?

    thanks for the hint! unfortunately, in that example form the user has to enter the exchange rates every time he fills out the form. i need to specify those rates within the form itself, somehow.. :/

    (i need just approximate values.) 

     

    what would be a really convenient way is if i could use some kind of if statements in the 'default value' box, since i only have a handful of currencies. like:

    if currency="CHF" {field_value=1*entered_price}
    else
      if currency="EUR" {field_value=1.5*entered_price}
      else
          if currency="USD" {field_value=1.3*entered_price}
          else {field_value=0 }

     

    ....... isn't there any documentation or so on the expression syntax? 

  • 05-08-2007 05:58 AM In reply to

    Re: where to save exchange rates that are used in a form?

    aah.. i got the solution!

    the descriped if/else tree can be modelled as:

     
    field_value=

    specified_price * (contains(currency, "CHF") + contains(currency, "EUR") * 1.5 + contains(currency, "USD") * 1.3 )

     

    since the contains(A, B) function returns 1 when field A contains string B, and 0 if it doesn't. :D

     

  • 05-08-2007 07:52 AM In reply to

    Re: where to save exchange rates that are used in a form?

    Well done!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 11-09-2009 09:55 PM In reply to

    Re: where to save exchange rates that are used in a form?

     

    Hi! How can u modify the objects of the expense report, no matter what i do it's locked?

     

    tx

     

     

Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.