Load Picture S’abonner

0
Avatar
Legacy Poster

Hi there,

I want to load or print a picture from an external file. I have a document with a graphic field named "Grafik 1", and I want to print this picture only if there is an text in database field "Anschluss-Hinweis".
I try this, but it doesn't works <_<

[code]
if Field(("PPS242F.Anschluss-Hinweis")=">0") then
Format.Objects("Grafik 1").DoNotPrint=false
else
Format.Objects("Grafik 1").DoNotPrint=true
end if
[/code]

Has somebody an Idea

7 commentaires

0
Avatar
Michael Toupin (mtoupin
Actions pour les commentaires Permalien

[quote name='casban' timestamp='1345123789' post='3090']
Hi there,

I want to load or print a picture from an external file. I have a document with a graphic field named "Grafik 1", and I want to print this picture only if there is an text in database field "Anschluss-Hinweis".
I try this, but it doesn't works <_<

[code]
if Field(("PPS242F.Anschluss-Hinweis")=">0") then
Format.Objects("Grafik 1").DoNotPrint=false
else
Format.Objects("Grafik 1").DoNotPrint=true
end if
[/code]

Has somebody an Idea
[/quote]

You can only set object visibility by doing the script in the document options menu. So to do this, you'll want to select File>BarTender Document Options, then choose the 'VB Scripting' tab, check 'use VB Scripting', then choose an event (I'd recommend using 'On New Record'). Put your script in there.

For verification, this script is checking for a field with the data object >0, and if it exists the object will not print. Is that correct?
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Hallo Mike,

I'm normaly programming in C#.
in this textfield is a text "Use rectifier-plug only", if this text found, the program shoud print Grafik 1, and if there is no text the program shoud not print the graphic.

Nice regards
Carsten B
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

The program give me this Error-Message
[code]
BarTender: ErrorMessage #6900
[/code]

We changed our printing software from EasyLabel to BarTender , so this ist a little bit difficult for me.
0
Avatar
Michael Toupin (mtoupin
Actions pour les commentaires Permalien

[quote name='casban' timestamp='1345180765' post='3093']
Hallo Mike,

I'm normaly programming in C#.
in this textfield is a text "Use rectifier-plug only", if this text found, the program shoud print Grafik 1, and if there is no text the program shoud not print the graphic.

Nice regards
Carsten B
[/quote]

In that case you'll want to use the script like this:

if Field(("PPS242F.Anschluss-Hinweis")="Use rectifier-plug only") then
Format.Objects("Grafik 1").DoNotPrint=false
else
Format.Objects("Grafik 1").DoNotPrint=true
end if
0
Avatar
Michael Toupin (mtoupin
Actions pour les commentaires Permalien

[quote name='casban' timestamp='1345181792' post='3094']
The program give me this Error-Message
[code]
BarTender: ErrorMessage #6900
[/code]

We changed our printing software from EasyLabel to BarTender , so this ist a little bit difficult for me.
[/quote]

What's the verbage of that error message?
0
Avatar
Legacy Poster
Actions pour les commentaires Permalien

Sorry for the late answer.

here is the text of the error message
[code]
The following script mistake was found:
<Line 3: :Object property is not supported. This property is only allowed if document event scripts are executed.>
[/code]
0
Avatar
Michael Toupin (mtoupin
Actions pour les commentaires Permalien

[quote name='casban' timestamp='1346310912' post='3169']
Sorry for the late answer.

here is the text of the error message
[code]
The following script mistake was found:
<Line 3: :Object property is not supported. This property is only allowed if document event scripts are executed.>
[/code]
[/quote]

That means that you're trying to do it in a label object. You're going to need to run that script at the document level. Go to File>Label Document Options, then select 'VB scripting' and select an event. Put it in the appropriate event and it should work.

Vous devez vous connecter pour laisser un commentaire.