Adding A Bmp Or Jpg Picture Conditionally S’abonner
I am reading a database file (excel) using Bartender Automation 9.4. The database table has a column that indicates if the item is certified or not. The cell contains either yes or no. If yes, I want to print the cert logo on the label. If no, change the properties to not print the logo. The logo is in a graphic folder but it will never change. I want that static logo to print not to print based on the content of the cell on the item being printed from the database. I saw a similar request in the forum based using check boxes and radio buttons but couldn't figure out how to tie the database field to the image I want to control. Is what I'm asking to do possible with my version of bartender?
5 commentaires
So ...
When I want the image to print, the database passes in "LOGO" and the image "\\server\share\path\L3LOGO.png" is printed on the label.
When I want no image to print, the database passes in "BLANK" and the image "\\server\share\path\L3BLANK.png" is printed on the label. L3BLANK.PNG is a 1 pixel white image, so the end result is nothing visible prints.
I think something similar would do what you're looking for (maybe having a "YES.jpg" and "NO.jpg" image or something). Hopefully it helps.
[code]if (certified = "yes") then
Format.Objects("Picture 4").DoNotPrint = false
else
Format.Objects("Picture 4").DoNotPrint = true
end if[/code]
if (certified = "yes") then
Format.Objects("Picture 4").DoNotPrint = false
else
Format.Objects("Picture 4").DoNotPrint = true
end if
In the above is that just a typo or am I missing something. You first said "assuming your picture name is picture 1" then Picture 4 is in the code?
Using the above template I entered:
if (Field("MLPins$.Kosher Qualified") = "yes") then
Format.Objects("Picture 1").DoNotPrint = false
else
Format.Objects("Picture 1").DoNotPrint = true
end If
I get an error when I press OK after modifying the code.
<Line 4: : Object property is not supported. This property is allowed only when running document event scripts.>
I don't understand the error.
MLPins$.Kosher Qualified is the cell that contains "yes" or blank in the database.
I have the logo picture type as "Data Sourced Picture:
Source is "Path" and the path is: C:\Do not back up\Zebra Labels EP\pcx\Kosher-Dairy.bmp
The data source is VB script and the general tab shows the object name as "Picture 1".
I like this codes approach and seems like it should work if I can get the ducks lined up right.
Suggestions.
As for your error message, It looks like you need to place this code in a document event control script. You can get to these in your file by going [i]File > Label Document Options[/i] and clicking the VB tab. (This would be under [i]Label Format Options[/i] in version 9.4-). From there, you can put the code from earlier in one of the event scripts. I would recommend putting it under the OnNewRecord script.
Hope you can follow all that.
Vous devez vous connecter pour laisser un commentaire.