Print Or Suppress Image Conditionally Part 2 Folgen

0
Avatar
Legacy Poster

In the topic Print Or Suppress Image Conditionally is explained how to, however it is not working for me.

I have 3 pictures, the object names are:
Afbeelding 1
Afbeedling 2
Afbeedling 3

Now I want to create in VB something that will show Afbeelding 1 when databasefield Assortment is 20, show Afbeelding 2 when databasefield is 30, show Afbeelding 3 when databasefield is 40 else show nothing.

Please advise.

====
I tested with the answer of last topic but when I insert in the more option VB scripting of my databasefield the code
[code]If value = 20 Then
value = "Objects.Afbeelding 1"
Else
value = ""
End If[/code]
I will get an error of BarTender in the code saying [i]Types are not correct: '[string: "Field: Date"]' in Line 8[/i] however the code does not have 8 lines...

5 Kommentare

0
Avatar
Legacy Poster
Aktionen für Kommentare Permalink

i sent you a PM, it's in dutch i hope you understand it. (because i saw afbeelding 1,2,3 :) )
0
Avatar
Legacy Poster
Aktionen für Kommentare Permalink

There are probably a few ways to do this, but one would be to set yout picture object to be type: "Data Sourced Picture"

You can then set the source to "Path", and set the default path of your graphics files (what folder on your computer they're in). Then, in the Data Source tab, choose "Visuaal Basic Script", Type: "Multi-Line Script", and you can use some type of code as follows:

[code]Select Case Number
Case 20
value= "Afbeelding 1.tif"
Case 30
value= "Afbeedling 2.tif"
Case 40
value= "Afbeedling 3.tif"
Case Else
value= "Afbeedling 4.tif"
End Select
[/code]


Setting the value in Case Else to "" may also work, I'm not sure. If not, just create an image called Afbeedling 4.tif and make it like 1 pixel x 1 pixel no color, and it will be the same as not printing at all.
0
Avatar
Legacy Poster
Aktionen für Kommentare Permalink

Will the code recognize characters instead of integers. To clarify instead of Case 30 can it be Case "gloves". Where the term gloves is coming from a view in Oracle and the associated icon is located in a separate file. I have potentially 15 different icons I can use but typically only 5 or so are actually included on the label. They represent our PPE requirements.


[quote name='nRyder' timestamp='1314965905' post='500']
There are probably a few ways to do this, but one would be to set yout picture object to be type: "Data Sourced Picture"

You can then set the source to "Path", and set the default path of your graphics files (what folder on your computer they're in). Then, in the Data Source tab, choose "Visuaal Basic Script", Type: "Multi-Line Script", and you can use some type of code as follows:

[code]Select Case Number
Case 20
value= "Afbeelding 1.tif"
Case 30
value= "Afbeedling 2.tif"
Case 40
value= "Afbeedling 3.tif"
Case Else
value= "Afbeedling 4.tif"
End Select
[/code]


Setting the value in Case Else to "" may also work, I'm not sure. If not, just create an image called Afbeedling 4.tif and make it like 1 pixel x 1 pixel no color, and it will be the same as not printing at all.
[/quote]
0
Avatar
Michael Toupin (mtoupin
Aktionen für Kommentare Permalink

[quote name='Jcush80' timestamp='1350920132' post='3551']
Will the code recognize characters instead of integers. To clarify instead of Case 30 can it be Case "gloves". Where the term gloves is coming from a view in Oracle and the associated icon is located in a separate file. I have potentially 15 different icons I can use but typically only 5 or so are actually included on the label. They represent our PPE requirements.
[/quote]

Certainly. You would just have to enclose it in quotes:

Case "Gloves"
value = 1
case "Hat"
value = 2

etc etc
0
Avatar
Legacy Poster
Aktionen für Kommentare Permalink

Actually what I ended up doing in Bartender 10.0 was using extternal picture file and selecting get file name from database field. This allowed me to use the name coming out of the database and setting the file path to where the icons are stored. The potential problem I have there is I have room for all 15 potential icons and I'm not sure how to deal with limiting them to only the ones that are called for in the database. Each potential icon I believe will have it's own column in the completed database which is why I opted to go with the "external picture file" as the picture source. The programmer that is creating my view is out this week so I'm not sure how the final view will look.



[quote name='Mike T - Seagull Support' timestamp='1350928988' post='3555']
Certainly. You would just have to enclose it in quotes:

Case "Gloves"
value = 1
case "Hat"
value = 2

etc etc
[/quote]

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.