on 12-10-2008 7:28 PM
Is there a way to place an image on the page that works off the following information.
All images are located in the 'c:\Graphics' folder.
The image names are 'Generic Door####.bmp'.
The '####' is a Field name of {Doors.Door Num} this a number format.
Example {Doors.Door Num} = 186 image Generic Door0186.bmp.
So I would get the {Doors.Door Num} place it a formula and the image would be retrieved.
Is this possible?
Place an image in which ever section you need it in. RIGHT click on the image and click on Format Graphic.
Click on Picture tab, and then on the x+2 button next to Graphic Location.
In the formula workshop window type this:
'c:\Graphics\Generic Door0' & {Doors.Door Num} & '.bmp';
Save & Close and it should display the images of the various doors depending on the value of the field.
Try it and see if it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok I'm not getting an image. I just shows the image I started with.
I believe that the 'Generic Door0' & {Doors.Door Num} & '.bmp' isn't returning a proper value. When I type in Generic Door0906.bmp it works.
The only other thing I was going to mention was what if the {Doors.Door Num} is 1 or 10 or 1000.
Then I think I would have to check the length of {Doors.Door Num}
Maybe if then else statements...
How do you check the length of {Doors.Door Num}?
Thanks for your help....
Kewl it worked....
Thanks so much...
Now I'm trying to rewrite it to check length of {Doors.Door Num}
If length (totext({Doors.Door Num},0,'','')) = 1 then
'C:\Planit\Solid_4_2\Database\Graphics\Generic Door000' & totext({Doors.Door Num},0,'','') & '.bmp' Else
If length (totext({Doors.Door Num},0,'','')) = 2 then
'C:\Planit\Solid_4_2\Database\Graphics\Generic Door00' & totext({Doors.Door Num},0,'','') & '.bmp' Else
If length (totext({Doors.Door Num},0,'','')) = 3 then
'C:\Planit\Solid_4_2\Database\Graphics\Generic Door0' & totext({Doors.Door Num},0,'','') & '.bmp' Else
'C:\Planit\Solid_4_2\Database\Graphics\Generic Door' & totext({Doors.Door Num},0,'','') & '.bmp'
Got it...
Thanks again for your help...
Hi Jeff,
You can also use this to remove if condition
'C:\Planit\Solid_4_2\Database\Graphics\Generic Door' & replicatestring('0',4-length(trim(totext({Doors.Door Num},0,'',''))))+trim(totext({Doors.Door Num},0,'','')) & '.bmp'
if in future you have file name with more zero padded, you just need to change the value from 4 to whatever number you want..
thanks,
Parv
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.