C# Select Object To Print Seguir

0
Avatar
Legacy Poster

Hi,

I have a set of 4 bar codes in a label, I am using Visual Studio C#, I want to control what bar code to print, I found something regarding this issue ("Format.Objects("Barcode1").DoNotPrint = true") but so far no luck yet.

My bartender format document is named
btFormat = btEngine.Documents.Open(@"C:\Dev\4BarCodeLabel.btw");

The 4 bar codes in 4BarCodeLabel are named:
BarCode01
BarCode02
BarCode03
BarCode04

My question is how do I access the Object Name "BarCode01" to turn ON/OFF the Property "[ ] Do Not Print Object" for the BarCode I want to print?.

What class/method do I need in my bartender formar btFormat?

Please someone help me.

9 comentarios

0
Avatar
Ian Cummings
Moderador
Acciones de comentarios Permalink

This has not yet been implemented in the .NET SDK component. It has been implemented if automating via the COM (ActiveX automation) method, and in the VB scripting that runs internally to the BarTender document.

Have you tried setting the data source of the barcode to nothing? When a data sourced object is given an <empty> value it generally won't print, which of course gives you the end result that you want.
0
Avatar
Legacy Poster
Acciones de comentarios Permalink

[quote name='Ian C - Seagull Support' timestamp='1355138910' post='3881']
This has not yet been implemented in the .NET SDK component. It has been implemented if automating via the COM (ActiveX automation) method, and in the VB scripting that runs internally to the BarTender document.

Have you tried setting the data source of the barcode to nothing? When a data sourced object is given an <empty> value it generally won't print, which of course gives you the end result that you want.
[/quote]
0
Avatar
Legacy Poster
Acciones de comentarios Permalink

Yes I did,

Assuming I want to print all the object except bar codes BarCode03 and BarCode04, I sent an empty value to these objects (btFormat.Substrings["Gtin03"].value = ""; btFormat.Substring["Gtin04"].value=""; )but this is causing not to print the label at all, the label has seven objects.

I'll appreciate any other idea
0
Avatar
Legacy Poster
Acciones de comentarios Permalink

Another solution is to have 4 different bartender documents ..

But I prefer to have only one. !!
0
Avatar
Michael Toupin (mtoupin
Acciones de comentarios Permalink

[quote name='Grapes' timestamp='1355164105' post='3888']
Yes I did,

Assuming I want to print all the object except bar codes BarCode03 and BarCode04, I sent an empty value to these objects (btFormat.Substrings["Gtin03"].value = ""; btFormat.Substring["Gtin04"].value=""; )but this is causing not to print the label at all, the label has seven objects.

I'll appreciate any other idea
[/quote]

What error message do you receive when doing this?
0
Avatar
Legacy Poster
Acciones de comentarios Permalink

I am not getting any error message, but when I send any empty value to any object contained in the label (BarCode01 to Barcode02, or to any other bar code) the label does not get print.

The solution I found was to create 4 different Bartender Documents (SSCCBar01.btw, SSCCBar02.btw, SSCCBar03.btw, SSCCBar04.btw) one for each quantity of bar codes needed, I am selecting a document based on how many bar codes I need to print in the label, the program runs well as I wanted to run. I just wanted the option to have only one bartender document for administrate/maintain purposes.

Do you think this option will be implemented soon in .NET SDK?
0
Avatar
Ian Cummings
Moderador
Acciones de comentarios Permalink

Setting the value of one sub-string on your label to a value of nothing WILL NOT cause the entire label not to print. I'm sorry but that is just not the case. Could it be that all objects on the label use the same named sub-string data source, which is why all objects do not print? That is the only possibility I can think of for the results you are getting.

When you say, "the label does not get print", do you mean that the printer feeds a blank label or that the printer does nothing?

Remember that you can always implement VB script inside the BarTender document to "not print" label objects based on conditional rules. See the below white paper for details:

http://www.bartenderbarcodesoftware.com/label-software/whitepapers/Dynamically-Changing-Objects-At-Print-Time-Using-VB-Script.pdf
0
Avatar
Legacy Poster
Acciones de comentarios Permalink

When I say, "the label does not get printed" I mean nothing is sent to the printer, so the printer does nothing, not even a blank label.

The moment I set values to the strings of all objects (bar code objects), the label gets sent to the printer and prints very well.

For your information I am using:
4 bar codes "02 Item Number of Goods Contained Withing Logistic Unit (GTIN)" object names (BarCode01,BarCode02,BarCode03,BarCode04)
1 bar code "00 SSCC-18 Serial Shipping Container Code"
2 Strings with company information

Those are my 7 objects I am using in the label.

And here is the way I assign values to the string in this case BarCode01: (This works very well)
btFormat.SubStrings["Gtin01"].Value = (tbBar1.Text).Substring(2, 13);
btFormat.SubStrings["Location01"].Value = (tbBar1.Text).Substring(18, (tbBar1.Text).Length - 18);
btFormat.SubStrings["Qty01"].Value = Convert.ToString(Convert.ToInt32(tbQ1.Text));

If I do not want the Barcode01 to print I initialized the strings to empty or null but this way the label does not get print at all, not blank label neither.
btFormat.SubStrings["Gtin01"].Value = "";
btFormat.SubStrings["Location01"].Value = "";
btFormat.SubStrings["Qty01"].Value = "";
0
Avatar
Ian Cummings
Moderador
Acciones de comentarios Permalink

I suggest you make the application object visible so that you can see what is happening inside BarTender. Probably an error to do with invalid data in the GS1 barcode. Note that the TOTAL data source of the barcode needs to be set to nothing. This will include the application identifiers, and not just the data fields.

Iniciar sesión para dejar un comentario.