TO MAKE NULL VALUE TO 1 AND TRY TO PRINT MANY COPY 追蹤

0
Avatar
Verinar Veri

Dear Sir,

we want to make print copies but when the field in our software is NULL then we get error on printing label. what we want is to write a VB screibt to avoid NULL but we failed. How can we solve that? Can you help us. We will be appreciated. Thanks. Regards

3 意見

0
Avatar
Pete Thane
評論操作 永久連結

This should get you up and running:

  1. Add a text field on to the template screen but place the field off to the side of the label so that it wont actually print.
  2. In the properties of the label use the Change Data Source Name button to give this field a name. I used NoOfLabs as you can see in the first image below.
  3. Make this field a Visual Basic Script field of the Event Controlled Script subtype and the click the Edit VB button.
  4. Change the On Auto-Selected Event value to Value = 1
  5. In the column on the left scroll down and choose the OnIdenticalCopies option and add the code shown in (and below) the second image. Please note I am not using a database connection and have added a second named field "InputLabs" to set the number of labels as if it were coming from a database.  For the 1st line of your code replace the line with Value = and then in column on the right scroll down to Database Fields and double click on the field that contains your number of labels value.
  6. Click Close and Close to come out of VB screen and then go toe File>Print option and on the Print Screen click the button just to the right of the Copies entry box (3rd image although you Copies box will say 1 at the moment and not Set By Data Source
  7. On the Next screen click Get Quantity from Data Source and the options in the column on the left will change
  8. Click on Data Source in this column and then in the area on the right choose the Change Data Source name button as above and then click on the name you set in 2 to link these fields together (final image) and then click OK, Close and Save your label and you are done

 

Value = Format.NamedSubStrings("InputLabs").Value

If Value = "Null" then

Value = 1

else Value = value

end if

 

 

 

 

0
Avatar
Verinar Veri
評論操作 永久連結

Tis is not working. we coulnt print more then 1. can you check again ?

0
Avatar
Pete Thane
評論操作 永久連結

Sorry it is case sensitive so change the line to

If Value = "NULL" 

登入寫評論。