1C Barcode using API And 1C:Small Business 1.4

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 14, 2013
Company:

Hello all!
i've accessed the 1C Barcode component using API but i print it not show right picture barcode, and in "1C:Small Business 1.4 (demo)" it show picture barcode template.

Example use API:

Code
Area.Drawings.D4.Object.CodeValue = "1111111110128";    
Area.Drawings.D4.Object.CodeText = "1111111110128";

SpreadsheetDocument.Put(Area);

Edited: P& A - Dec 04, 2014 12:29 AM
 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, P& A!

Please see following topcs for examples of using the 1C barcode printing control:

 
#3
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 14, 2013
Company:

Hello, Timofey Bugaevsky!

I read 2 topic but i can't print it.

example :

Code
ConnectionCompleted = AttachAddIn("CommonTemplate.InBarcode", 
         "BarCodePicture", AddInType.Native);
   If ConnectionCompleted Then
      ExternalComponent = New("AddIn.BarCodePicture.Barcode");
   Else
      Return Undefined;
   EndIf;
    ExternalComponent.CodeType = 1;
   ExternalComponent.CodeValue = TrimAll(Code);
   ExternalComponent.CodeText = TrimAll(Code);
   Area.Drawings.D4.Picture = ExternalComponent.GetBarcode();  // template has got picture name "D4"
// error because: Type mismatch
Area.Drawings.D3.Picture = ExternalComponent.GetBarcode(); 


I don't know why it's error ?


This answer Andrey Golyshev
Quote
Actually i've accessed the 1C Barcode component using API only and it's working fine.

For example:
Area.Drawings.EAN.Object.CodeValue = "1234567890128"; // Change "1234567890128" = "1234567890111" but print still "1234567890128"

Here:
- Area - is area cells of table document;
- Drawings - is a collection of attached drawings;
- EAN - is a name of drawing containg ActiveX object;
- Object - is drawing property referencing 1C Barcode object;
- CodeValue - 1C Barcode property containing text for constructing the barcode.

Edited: P& A - Dec 04, 2014 12:36 AM
 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

You need to convert the BinaryData into the Picture to assign it to the drawing:

Code
   // Generating a picture
   PictureBinaryData = ExternalComponent.GetBarcode();

   // If the picture is generated
   If Not PictureBinaryData = Undefined Then

      // Generating from the binary data
      Area.Drawings.D4.Picture New Picture(PictureBinaryData);

   EndIf;

 
#5
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 14, 2013
Company:

Hello, Timofey Bugaevsky!

Barcode using API
I didn't set : "CodeAuto = True" so it print template.

Barcode using "AttachAddIn"
I did it, but my picture has got message "the size very small", i try put hight, width but not success.
How do i do ?

Edited: P& A - Dec 04, 2014 01:18 AM
 
#6
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Please download Managed application demo. There is a simpler example. See the object module of the Goods catalog.

 
#7
People who like this:0Yes/0No
Active user
Rating: 2
Joined: Jan 14, 2013
Company:

Hello, Timofey Bugaevsky!

Thanks you for this example.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.