Identical Number Of Copies Is Sourced By A Data Source. Identical Number Of Copies Must Be Sourced By The Print Dialog. S’abonner
I am using bartender 9.4 EA activeX with vb.net. and below is my code to print the label
[code] btApp.Visible = False
btFormat = btApp.Formats.Open(strLabelPath.Trim, False, "")
btDb = btFormat.Databases.GetDatabase(1)
btDb.OLEDB.UserId = p_objGlobalConn._DBUserID
btDb.OLEDB.Password = p_objGlobalConn._DBPassword
btDb.OLEDB.SQLStatement = strSQL.Trim
btFormat.IdenticalCopiesOfLabel = strCopy.Trim /*<-- hit error*/
btFormat.Printer = strPrinter.Trim
btFormat.PrintOut(False, False)
btFormat.Close(BtSaveOptions.btDoNotSaveChanges)[/code]
Originally this code was OK. But when I chenge the label templates, under the file-Print, Identical copies of label and number of serialized labels i set to database field, it hits the error. if I comment out the "btFormat.IdenticalCopiesOfLabel". it does not print anything.
How to use the identical copy from the label template? I would like to set the identical copy from the database field.
5 commentaires
In the data source for the print quantity in the label format, make sure that the default value for the field is set to 1.
Out of interest, if you specify a literal numeric value does the code work okay printing that number of labels?
Sorry to say I forget to mention, let take a look for my scenario
Specific identical label on coding and hardcode the printing label setting copy to 1 = working fine
do not specific identical label on coding and set the printing label to database field = nothing printed
btFormat = btApp.Formats.Open(strLabelPath.Trim, False, "")
btDb = btFormat.Databases.GetDatabase(1)
btDb.OLEDB.UserId = p_objGlobalConn._DBUserID
btDb.OLEDB.Password = p_objGlobalConn._DBPassword
btDb.OLEDB.SQLStatement = strSQL.Trim
btFormat.Printer = strPrinter.Trim
btFormat.PrintOut(False, False)
btFormat.Close(BtSaveOptions.btDoNotSaveChanges)
[/code]
if I using the code above and set the identical copy as database field, nothing is printed.
2. The code seems fine to me.
3. Are you sure that the field you specified for the print quantity contains valid integer data? Did you specify a default value of 1 in the BarTender document like previously mentioned?
4. Enable application message logging in BarTender and check for any error generated. Do this via the "Administer>Application message setup" menu item.
Vous devez vous connecter pour laisser un commentaire.