Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / June 2005

Tip: Looking for answers? Try searching our database.

how do I add the results of an expression in infopath

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
elgar22 - 12 Jun 2005 15:15 GMT
Using Inforpath 2003 with SP1

I want to make an order form that can caluculate the total amount for each
item ordered using an expression, I also want a overall total of all items. I
can sum a column of numbers but is there a way to sum a column of expressions?

Thanks
Scott L. Heim [MSFT] - 14 Jun 2005 16:22 GMT
Hi,

You can use the "Sum" function in your total field but it will need to use
the same basic expression as the original Expressions Boxes. For example,
let's say you have an Expression Box for each line item that uses the
following expression:

my:field1 + my:field2

If you wanted to have a final Expression Box that totaled all of these Line
Item expressions, it would look like the following:

sum(field1) + sum(field2)

** NOTE: This is using the built-in "builder" - the actual XPath expression
for this is as follows:

sum(my:group1/my:group2/my:field1) + sum(my:group1/my:group2/my:field2)

I hope this helps!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Renee in Juneau - 14 Jun 2005 18:21 GMT
You'll make life SO much easier on yourself if you store the item's
total amount in a field rather than strictly as an expression box
value. If you don't want to have  item totals as part of your schema,
create a secondary schema and store them there as a set of related
throwaway values.

>Using Inforpath 2003 with SP1
>
[quoted text clipped - 3 lines]
>
>Thanks
elgar22 - 14 Jun 2005 23:32 GMT
Thanks for the input, Renee, but I'm pretty new to Infopath and don't really
understand the idea of schemas without seeing it. Scott's solution seems like
something I can cope with. I have fields Quantity, Unit Price and Amount
where my original expression in amount is "my:No*my:Price" what would my
expression look like to sum all of these calculation?

> You'll make life SO much easier on yourself if you store the item's
> total amount in a field rather than strictly as an expression box
[quoted text clipped - 9 lines]
> >
> >Thanks
Renee in Juneau - 15 Jun 2005 07:51 GMT
Yeah, I'm pretty new to Infopath, too, but the flexibility of the
product fascinates me. My big push with respect to forms right now is
to learn Xpath and XSLT so I can really leverage things (while saving
lots of time).

Anyway, if you were storing Item_Total in a (some numeric format)
textbox rather than as an expression box, I think all you'll need is
to create a rule on the Grand_Total textbox (which is also set to some
numeric format and is placed outside the repeating table, right?).

This one rule would always apply. The action would be "Set A Field's
Value". The field would be itself and the value would be
"sum(Item_Total)"

>Thanks for the input, Renee, but I'm pretty new to Infopath and don't really
>understand the idea of schemas without seeing it. Scott's solution seems like
[quoted text clipped - 15 lines]
>> >
>> >Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.