Newbie question on conditional formatting

T

Tim

I was recently handed an Infopath file that I have been asked to update and
enhance for one of our departments. I have never used InfoPath before now,
but I have been able to handle all of the content changes.

The document is a foodservice menu with multiple sections (breakfast, lunch,
dinner, etc). At present when food service prints the submitted form (it
submits to a SharePoint form library), they end up printing the entire
document (7 pages).

I am looking for a way to only print completed sections. I have tried using
an optional section that is set to include by default and using conditional
formatting based on the section subtotal (total=0 then hide the section) but
of course at form load, the total is 0 and the section is hidden.

What I would like to do is tie the conditional formatting to the Submit
button but I have not found a way to programmatically hide a different
control based on conditions. That is, when I click submit, it should hide any
sections with a subtotal of 0 and then submit the form to the SharePoint form
library.

Any suggestions?
 
C

Clay Fox

Typically you need an extra field for each section that would be used, maybe
as a true false that would be used to show or not show each section.

Set these to false by default and format each section to hide if true.

Then I would put a rule on submit that checks each section total and updates
these values to true if 0.
then the next rule submits.

Another option is you can have a seperate print view which can hide sections
for printing but they can be viewable for users in the main view.

--
Thanks

Clay Fox

Qdabra Software
http://www.qdabra.com

InfoPathDev.Com
The Largest InfoPath Forum in the World
http://www.infopathdev.com
 
T

Tim

Clay,
Thank you for the response. I am not quite sure how to add items to a
print view based on conditions so I am attempting the additional field method.

I have created a checkbox in the section with a default state of cleared and
set the section to hide if the check field is true.
Testing of this control is successful.

I changed the submit button to a Rules and Custom Code action and created a
rule with the following attributes:
Condition - field520 is equal to 0
Action - Set a field's value
Field: NoBreakfast
Value: 1

However, when I preview the form and click the button, the section does not
hide.

Could it be a format issue? The condition field has the following attributes:
Data Type: Decimal (double) with currency format and 2 decimal places
Display is read-only
Value is calculated by adding the several line item fields.

I have tried using 0 and 0.00 as the condition with the same results.

Any thoughts would be greatly appreciated.
 
T

Tim

Please disregard the second half of my last response. I was able to get it
working by changing the control to "1" and "0" instead of "True" and "False".

It is working now.

Thanks again for the help.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top