Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > 1C Barcode using API And 1C:Small Business 1.4

Forum

Search UsersRules
1C Barcode using API And 1C:Small Business 1.4
#1
Active user
Points:: 0
Joined:: Jan 14, 2013

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);

Profile
#2
Guest
Points::
Joined::

Hello, P& A!

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

Profile
#3
Active user
Points:: 0
Joined:: Jan 14, 2013

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.

Profile
#4
Guest
Points::
Joined::

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;

Profile
#5
Active user
Points:: 0
Joined:: Jan 14, 2013

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 ?

Profile
#6
Guest
Points::
Joined::

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

Profile
#7
Active user
Points:: 0
Joined:: Jan 14, 2013

Hello, Timofey Bugaevsky!

Thanks you for this example.

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.