Skip to main content
Answer

Report Designer: Barcodes displaying their Value

  • March 10, 2023
  • 7 replies
  • 613 views

Michaelh
Pro I
Forum|alt.badge.img+2

I’m in the Report Designer. I have a barcode. How do I integrate the value of the barcode into the barcode as shown below. It doesn’t have to be nested into the code as shown below, underneath is fine too.

My issue is that barcodes are variable in length and they completely ignore text alignment, so I can’t center the Item Number (my value) under the barcode. The barcode is always left justified making for some very ugly labels.
 

Thanks!

Best answer by Robert Sternberg

Here is an example you can build upon.  The solid line in the image represents the length of both the Barcode Image Object and the Text Box for the description. 

 

To center the text based on the length of the barcode value + a static offset amount.

=PadLeft([InventoryItem.InventoryCD],Len([InventoryItem.InventoryCD])+6, ' ')

 

To center the text based on the length of the barcode value + a dynamic offset amount based on the length of the barcode value.

=PadLeft([InventoryItem.InventoryCD],Len([InventoryItem.InventoryCD])+CInt(Len([InventoryItem.InventoryCD])/2), ' ')

 

 

7 replies

Robert Sternberg
Captain II
Forum|alt.badge.img+7

Could you share your RPX file and/or the barcode type you are using. 

 

Thanks


Michaelh
Pro I
Forum|alt.badge.img+2
  • Author
  • Pro I
  • March 10, 2023

 

That is my current Barcode setup. The only thing under STYLE is a center alignment on the text that doesn’t seem to do much. I have tried swapping to other barcode formats, still nothing I can find to center the barcode with the Item Number. Below is my output:

 

 


Robert Sternberg
Captain II
Forum|alt.badge.img+7

Alright, here is an idea.  If the barcode width is, in theory, directly correlated to the length of the value it represents, in this case inventory CD, would it be possible to left align the value and add padding of empty space based on the length of the inventory CD.  
 

I’ll see if I can work up an example.   There could also be something we are missing to help with barcode alignment I am just not aware of what that would be. 


Robert Sternberg
Captain II
Forum|alt.badge.img+7

Here is an example you can build upon.  The solid line in the image represents the length of both the Barcode Image Object and the Text Box for the description. 

 

To center the text based on the length of the barcode value + a static offset amount.

=PadLeft([InventoryItem.InventoryCD],Len([InventoryItem.InventoryCD])+6, ' ')

 

To center the text based on the length of the barcode value + a dynamic offset amount based on the length of the barcode value.

=PadLeft([InventoryItem.InventoryCD],Len([InventoryItem.InventoryCD])+CInt(Len([InventoryItem.InventoryCD])/2), ' ')

 

 


Michaelh
Pro I
Forum|alt.badge.img+2
  • Author
  • Pro I
  • March 13, 2023

That’s not the “right” answer, but it’ll do perfectly since we can’t embed the values or get the barcodes to recognize the alignment setting! Thank you for posting this fix, it’s very simple to execute.


Robert Sternberg
Captain II
Forum|alt.badge.img+7

@Michael Hansen 

Glad this worked for your use case.  I would agree, it might be worth creating an Acumatica Idea to allow for centering barcode image based on text alignment values which would be most ideal. 

 


Forum|alt.badge.img+8
  • Semi-Pro I
  • October 1, 2024

@Mica Mitchell @Robert Sternberg Did you come across a different solution/configuration for the Barcode than adding padding. Please advise.