Barcode Printing Component In Manager Application

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi

From SmallBysiness I restored BarcodePrintingComponents for linux 32, 64, Win 32, 64 and then loaded to commontemplates.

When the form is opened, according to clients platformtype I save the binarydata to tempstorage.

And when I want to install the externalcomponent that saved to tempstorage, I recieve an error. Eroor message is, "External component was not installed! Error in installation process!"

Example code is here:

Code
ConnectionCompleted = Undefined;

ConnectionCompleted = DışBileşenAttach();

If Not ConnectionCompleted Then
   If DışBileşenYükle(SystemInfo) Then
      ConnectionCompleted = DışBileşenAttach();
   EndIf; 
EndIf; 

// Create object of external component
If ConnectionCompleted Then
   ExternalComponent = New("AddIn.BarCodePicture.Barcode");
Else
   Return Undefined;
EndIf;

&AtClient
Function DışBileşenAttach(SystemInfo)
   
   ConnectionCompleted = AttachAddIn(ExComponentAdress, "BarCodePicture", AddInType.Native);
   
   Return ConnectionCompleted;
   
EndFunction // DışBileşenYükle()

&AtClient
Function DışBileşenYükle()
   
   SuccessFull = False;
   
   Try
      InstallAddIn(ExComponentAdress);
      SuccessFull = True;
   Except
      
   EndTry;
   
   Return SuccessFull;
   
EndFunction // DışBileşenYükle()

 
#2
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

How you save binary data to tempstorage?

1C Company support team
 
#3
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Such:

Code
   If Sistem = "Win32" Then
      Değer = GetCommonTemplate("BarcodePrintingComponentWindows32_idr");
   ElsIf Sistem = "Win64" Then
      Değer = GetCommonTemplate("BarcodePrintingComponentWindows64_idr");
   ElsIf Sistem = "Lin32" Then
      Değer = GetCommonTemplate("BarcodePrintingComponentLinux32_idr");
   ElsIf Sistem = "Lin64" Then
      Değer = GetCommonTemplate("BarcodePrintingComponentLinux64_idr");
   EndIf; 

   Adres = PutToTempStorage(Değer, New UUID);

 
#4
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

try use name of common template on client, for example:

Code
InstallAddIn("CommonTemplate.BarcodePrintingComponentWindows32_idr");

Edited: Sergey Naumov - Jul 12, 2013 03:01 AM
1C Company support team
 
#5
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

No it doesn't work

 
#6
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

Post the entire module of the form

1C Company support team
 
#7
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Code
&AtClient
Function AttachAddInOfBarcodePrinting() Export 
   
   // Depending on platform type connect required external component
   ConnectionCompleted = Undefined;

   ConnectionCompleted = DışBileşenAttach();
   
   If Not ConnectionCompleted Then
      If DışBileşenYükle() Then
         ConnectionCompleted = DışBileşenAttach();
      EndIf; 
   EndIf; 
   
   // Create object of external component
   If ConnectionCompleted Then
      ExternalComponent = New("AddIn.BarCodePicture.Barcode");
   Else
      Return Undefined;
   EndIf;
   
   // If there is no option to draw
   If NOT ExternalComponent.GraphicsPresent Then
      // Can't generate picture
      Return Undefined;
   Else
      
      // Setup component main parameters
      
      // If Tahoma font is installed in the system
      If ExternalComponent.FindFont("Tahoma") = True Then
         // Choose it as font for picture
         ExternalComponent.Font = "Tahoma";
      Else
         
         // No Tahoma font in the system
         // Loop over all fonts available for component
         For Acc = 0 To ExternalComponent.NumberOfFonts -1 Do
            // Get next font, available for component
            CurrentFont = ExternalComponent.FontAt(Acc);
            // If font is available
            If CurrentFont <> Undefined Then
               // It'll be the font for generating bar-code
               ExternalComponent.Font = CurrentFont;
               Break;
            EndIf;
         EndDo;
      EndIf;
      
      // Set font size
      ExternalComponent.FontSize = 12;
      
      Return ExternalComponent;
      
   EndIf;
   
EndFunction

&AtClient
Function DışBileşenAttach()
   
   Sys = New SystemInfo;
   If Sys.PlatformType = PlatformType.Windows_x86 Then
      TemplateName = "BarcodePrintingComponentWindows32_idr";
   ElsIf Sys.PlatformType = PlatformType.Windows_x86_64 Then
      TemplateName = "BarcodePrintingComponentWindows64_idr";
   ElsIf Sys.PlatformType = PlatformType.Linux_x86 Then
      TemplateName = "BarcodePrintingComponentLinux32_idr";
   Else 
      TemplateName = "BarcodePrintingComponentLinux64_idr";
   EndIf; 
   
   ConnectionCompleted = AttachAddIn("CommonTemplate."+TemplateName, "BarCodePicture", AddInType.Native);
   
   Return ConnectionCompleted;

EndFunction // DışBileşenYükle()

&AtClient
Function DışBileşenYükle()

   SuccessFull = False;
   
   Sys = New SystemInfo;
   If Sys.PlatformType = PlatformType.Windows_x86 Then
      TemplateName = "BarcodePrintingComponentWindows32_idr";
   ElsIf Sys.PlatformType = PlatformType.Windows_x86_64 Then
      TemplateName = "BarcodePrintingComponentWindows64_idr";
   ElsIf Sys.PlatformType = PlatformType.Linux_x86 Then
      TemplateName = "BarcodePrintingComponentLinux32_idr";
   Else 
      TemplateName = "BarcodePrintingComponentLinux64_idr";
   EndIf; 
      
   Try
      InstallAddIn("CommonTemplate."+TemplateName);
      SuccessFull = True;
   Except
      
   EndTry;
   
   Return SuccessFull;
   
EndFunction // DışBileşenYükle()

Edited: Murat Yazlıyev - Mar 26, 2014 04:50 AM
 
#8
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

In Chrome I recieve such message when I want to install the component: "Add-ins are not supported by this web browser"

 
#9
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

In other browsers I recieve the message: "External component was not installed! Error in installation process!"

 
#10
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Is there any working example where system configuration is thus:
Server Config - Ununtu 12.10 (64-bit). PostgreSQL_9_2_1_1_1C_x86_64 1C:Enterprise 8.2.17.157
Client Config - Web Browsers in Linux OS and Windows OS

 
#11
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

Attach to post yours template "BarcodePrintingComponentWindows32_idr": double click on template at configuration tree - save to file

1C Company support team
 
#12
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Sergey, in this forum attachment doesn't exceed more than 1 Mb. the attachment is 4-5 Mb. I will copy those binarydatas to ftp and will send you acception from private

 
#13
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

So Sergey, any news?

 
#14
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jul 3, 2013
Company: 1C Company

I test your code on another BarcodePrintingComponents - it works
I send example to your mail
I think that you restored wrong component, or component was saved in wrong format

1C Company support team
 
#15
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Ok, I'll wait for mail.

 
#16
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

Hi Sergey,

I have tested your component, that component works on Thin Client. But, on Web-Client not working. Is there exist some setting for Web-Client?

 
#17
People who like this:0Yes/0No
Interested
Rating: 27
Joined: Apr 5, 2012
Company: 1TÇ Şirketi - Merv Bilgi İşlem Otomasyonu Yazılım Ltd. Şti.

I solved it :). Thanks for everything!

 
#18
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Can you provide more information on how you solved this for other users?

 
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.