Add local TIF file to a Picture Field using a Button

D

DLocke

I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
J

J Galloway

You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

....you have to flip it around...

When [X] is [false] DON'T show the control
 
D

DLocke

That sounds like a great idea, but I don't think it will work in my case.
The picture I am adding is different for each person who clicks the button.
The file I need to shows is always in the same location, "C:\temp\pic.tif",
but the pic.tif file has a different picture for each person.
EX: I click the button and pic.tif shows a football. If you click the button
the pic.tif shows a basketball.
So, I need the button to go get the pic.tif file on the computer of the
person currently clicking the button.

Thank you for your suggestion.


J Galloway said:
You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

...you have to flip it around...

When [X] is [false] DON'T show the control


DLocke said:
I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
J

J Galloway

Ahh, I read your post and thought you knew how to insert the picture
dynamically... just not how to hide it until you wanted it shown.

Assuming you're using IP2007, do this:

1) Insert a picture control where you want your picture
2) A dialog will appear, choose "as a link"
3) Your picture control is placed on the page, and a new field to hold the
link to the picture file is placed in your data source
4) Go to your data source and edit the new field to contain the path to the
picture you want, ie C:\mypicture.jpg (you'll see the picture appear in the
control when you save the field data) Note, this assumes all picture
filenames for users are the same name in the same path on each computer... if
that is not the case you'll have to update the filename in the datasource
field to reflect the path/file it is stored for the user accessing the form
5) Double click on the picture control to open it's properties
6) Uncheck the "allow user to browse for new pictures" option on the "data"
tab
7) Click the "display" tab and conditional formatting button to apply a
conditional formatting rule as I explain previously.

That worked for me... although I didn't have a tif handy, just a jpg.
Because it's a link to a local drive and not embedded in the form, it should
show each user whatever picture they have saved in that path on their own
machine.

Hope this helps!



DLocke said:
That sounds like a great idea, but I don't think it will work in my case.
The picture I am adding is different for each person who clicks the button.
The file I need to shows is always in the same location, "C:\temp\pic.tif",
but the pic.tif file has a different picture for each person.
EX: I click the button and pic.tif shows a football. If you click the button
the pic.tif shows a basketball.
So, I need the button to go get the pic.tif file on the computer of the
person currently clicking the button.

Thank you for your suggestion.


J Galloway said:
You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

...you have to flip it around...

When [X] is [false] DON'T show the control


DLocke said:
I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
D

DLocke

I appreciate our help but the issue has one more twist that I forgot to
mention before.
I need the field to stay blank until someone clicks the button, then I need
that persons image to show in the field and never be removed.
EX: If I open the form first and click the button, a football image will
show in the field. When you open the form after me, you will see a football
and will not be able to remove or change the image.
If you open the form first and click the button, a basketball will show.....


J Galloway said:
Ahh, I read your post and thought you knew how to insert the picture
dynamically... just not how to hide it until you wanted it shown.

Assuming you're using IP2007, do this:

1) Insert a picture control where you want your picture
2) A dialog will appear, choose "as a link"
3) Your picture control is placed on the page, and a new field to hold the
link to the picture file is placed in your data source
4) Go to your data source and edit the new field to contain the path to the
picture you want, ie C:\mypicture.jpg (you'll see the picture appear in the
control when you save the field data) Note, this assumes all picture
filenames for users are the same name in the same path on each computer... if
that is not the case you'll have to update the filename in the datasource
field to reflect the path/file it is stored for the user accessing the form
5) Double click on the picture control to open it's properties
6) Uncheck the "allow user to browse for new pictures" option on the "data"
tab
7) Click the "display" tab and conditional formatting button to apply a
conditional formatting rule as I explain previously.

That worked for me... although I didn't have a tif handy, just a jpg.
Because it's a link to a local drive and not embedded in the form, it should
show each user whatever picture they have saved in that path on their own
machine.

Hope this helps!



DLocke said:
That sounds like a great idea, but I don't think it will work in my case.
The picture I am adding is different for each person who clicks the button.
The file I need to shows is always in the same location, "C:\temp\pic.tif",
but the pic.tif file has a different picture for each person.
EX: I click the button and pic.tif shows a football. If you click the button
the pic.tif shows a basketball.
So, I need the button to go get the pic.tif file on the computer of the
person currently clicking the button.

Thank you for your suggestion.


J Galloway said:
You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

...you have to flip it around...

When [X] is [false] DON'T show the control


:

I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
J

J Galloway

It's easy to keep it blank until x() happens... because the path to the img
file thats shown the picture control is stored in a field. You can default
that field to empty then write your path to it whenever you want using a rule
or code.

In addition, even if you keep the path stored in the field all the time, as
long as they open the form on different computers and the img file path is
local, when they open it they should see whatever is stored on the local
machine.




DLocke said:
I appreciate our help but the issue has one more twist that I forgot to
mention before.
I need the field to stay blank until someone clicks the button, then I need
that persons image to show in the field and never be removed.
EX: If I open the form first and click the button, a football image will
show in the field. When you open the form after me, you will see a football
and will not be able to remove or change the image.
If you open the form first and click the button, a basketball will show.....


J Galloway said:
Ahh, I read your post and thought you knew how to insert the picture
dynamically... just not how to hide it until you wanted it shown.

Assuming you're using IP2007, do this:

1) Insert a picture control where you want your picture
2) A dialog will appear, choose "as a link"
3) Your picture control is placed on the page, and a new field to hold the
link to the picture file is placed in your data source
4) Go to your data source and edit the new field to contain the path to the
picture you want, ie C:\mypicture.jpg (you'll see the picture appear in the
control when you save the field data) Note, this assumes all picture
filenames for users are the same name in the same path on each computer... if
that is not the case you'll have to update the filename in the datasource
field to reflect the path/file it is stored for the user accessing the form
5) Double click on the picture control to open it's properties
6) Uncheck the "allow user to browse for new pictures" option on the "data"
tab
7) Click the "display" tab and conditional formatting button to apply a
conditional formatting rule as I explain previously.

That worked for me... although I didn't have a tif handy, just a jpg.
Because it's a link to a local drive and not embedded in the form, it should
show each user whatever picture they have saved in that path on their own
machine.

Hope this helps!



DLocke said:
That sounds like a great idea, but I don't think it will work in my case.
The picture I am adding is different for each person who clicks the button.
The file I need to shows is always in the same location, "C:\temp\pic.tif",
but the pic.tif file has a different picture for each person.
EX: I click the button and pic.tif shows a football. If you click the button
the pic.tif shows a basketball.
So, I need the button to go get the pic.tif file on the computer of the
person currently clicking the button.

Thank you for your suggestion.


:

You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

...you have to flip it around...

When [X] is [false] DON'T show the control


:

I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
D

DLocke

I know this sounds a litte confusing, but your last responce is not exactly
what I need. Here is what I need:
EX: If I am the first one to open the InfoPath form, I click the button
which inserts a picture of a football. I save and close the form. You open
the InfoPath form next and can see that a picture of a football is already in
the form and do not have the ability to change or delete the picture. Anyone
else that opens the form will see the football picture and do not have the
ability to change or delete the picture.
So, in short, the first person to open the form and click the button will
insert there specific picture in the form, once they save and close the form
nobody else will be able to change or delete the picture.

I do appreciate your patience and support with my issue.

J Galloway said:
It's easy to keep it blank until x() happens... because the path to the img
file thats shown the picture control is stored in a field. You can default
that field to empty then write your path to it whenever you want using a rule
or code.

In addition, even if you keep the path stored in the field all the time, as
long as they open the form on different computers and the img file path is
local, when they open it they should see whatever is stored on the local
machine.




DLocke said:
I appreciate our help but the issue has one more twist that I forgot to
mention before.
I need the field to stay blank until someone clicks the button, then I need
that persons image to show in the field and never be removed.
EX: If I open the form first and click the button, a football image will
show in the field. When you open the form after me, you will see a football
and will not be able to remove or change the image.
If you open the form first and click the button, a basketball will show.....


J Galloway said:
Ahh, I read your post and thought you knew how to insert the picture
dynamically... just not how to hide it until you wanted it shown.

Assuming you're using IP2007, do this:

1) Insert a picture control where you want your picture
2) A dialog will appear, choose "as a link"
3) Your picture control is placed on the page, and a new field to hold the
link to the picture file is placed in your data source
4) Go to your data source and edit the new field to contain the path to the
picture you want, ie C:\mypicture.jpg (you'll see the picture appear in the
control when you save the field data) Note, this assumes all picture
filenames for users are the same name in the same path on each computer... if
that is not the case you'll have to update the filename in the datasource
field to reflect the path/file it is stored for the user accessing the form
5) Double click on the picture control to open it's properties
6) Uncheck the "allow user to browse for new pictures" option on the "data"
tab
7) Click the "display" tab and conditional formatting button to apply a
conditional formatting rule as I explain previously.

That worked for me... although I didn't have a tif handy, just a jpg.
Because it's a link to a local drive and not embedded in the form, it should
show each user whatever picture they have saved in that path on their own
machine.

Hope this helps!



:

That sounds like a great idea, but I don't think it will work in my case.
The picture I am adding is different for each person who clicks the button.
The file I need to shows is always in the same location, "C:\temp\pic.tif",
but the pic.tif file has a different picture for each person.
EX: I click the button and pic.tif shows a football. If you click the button
the pic.tif shows a basketball.
So, I need the button to go get the pic.tif file on the computer of the
person currently clicking the button.

Thank you for your suggestion.


:

You should be able to accomplish that with conditional formatting on the
picture control... just add a formatting rule that hides it until some
condition is met. For example, you could have the formatting rule watch the
date field you are setting with the button, and when it's no longer blank
show the picture control.

Remember the logic around show/hide is somewhat backwards... there is no:

When [X] is [true] show the control

...you have to flip it around...

When [X] is [false] DON'T show the control


:

I have created a button that when clicked will add the current date to a
field. This works just fine. But, I would also like to set a picture field
using a TIF file on my local file system using the button.
I know you can set the picture properties to "Show the placeholder" or
"Specify default picture". But I don't want the picture to appear until the
button is clicked.
I looked into the rules but I don't see an option that would allow you to
import a local file.
 
J

J Galloway

OK... before I type too much... does the picture file need to be imbedded in
the form itself, or can it be a link to a picture, say on a webserver
somewhere?
 

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