New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

Crystal Reports remove commas and decimal from number field?

We're using IDAutomation's QR Code Generator for Crystal Reports; I'm having an issue with how the QR returns one of the number data fields. The field is numeric, but formatted for no comma dividers or decimals. The scan of that field encoded in the QR code comes back formatted like a regular number with commas.

Serial Number in human text on label: 15144789
Serial number when scanned from QR: 15,144,789.00

I'm looking to verify how to code this correctly. Each of the items listed must be displayed in the order listed when scanning the code. Here's what I have currently.
DataToEncode = {Job.Part_Number} & "~d013" & {@Serial Number} & "~d013" & {@Quantity String} & "~d013" & {@PO String} & "~d013" & {@Serial Number}
My problem field is {@Serial Number}. I'd like to have that display as a string instead of an integer, but I'm not sure how to use the "Dim DataToEncode as String" feature. Any guidance would be greatly appreciated.

Operating System: Windows Server 2019

Application: Crystal Reports 2013

02-19-25     95 day(s) ago    

  Report Abuse

 

debrac

Best Answer

This issue with commas appearing in numeric results is by design of Crystal Reports formatting and not for the barcode software or encoding process. Each field has to be set in Crystal Reports not to display numerical results with commas. The recommendation is to try the following:

Format the field in Crystal Report Designer:
1. Right-click on the database field, select Format Object or Format Field.
2. Select Custom Style in the Style list, and choose Customize.
3. Uncheck the Thousands Separator and choose OK.
4. If you do not want a decimal separator, change Decimals to "1".
5. Make sure the number is appearing properly in the sample preview.
image

This is also explained in the StackOverflow article How to remove the comma from crystal report string and integer field to convert the number field to a string before it is encoded in the barcode.

The coding method may also work depending on your database:
Replace (ToText ({Table.NumberField}, 0),"," ,"" )
or
ToText( ToNumber({Table.NumberField}), "#" )

If you are still experiencing issues, we recommend reading out to SAP Crystal Reports Support for further assistance in formatting the data to be passed to the encoder.

Posted 95 day(s) ago

(0)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.
Other Answers (2)
Others that have had this issue had to take the actions in the linked article I provided to remove the thousands separators from the DB fields and in this case you would also uncheck the box for a decimal separator to remove the .00 after the number. These additions to the data are coming from the database settings in Crystal Reports and therefore ToText or cStr may not work because these commands tell Crystal Reports to display what is being pulled from the database as a text string. If the commas and .00 are being added to the database itself by Crystal Reports settings, ToText or cStr will still display those characters as part of the text string. There is a video in the link to the article showing where these items must be checked or unchecked in this case to remove them from the data fields.

The barcode encoder can only take the data that is sent to it and display it in the barcode, it cannot add or remove data independently which is why these items need to be addressed in the database.

Posted 95 day(s) ago

(0)
(0)
   Report Abuse
Thanks for the reply and suggestion. What has me confused is that the field is formatted as text within Crystal. All my format options are text related. I'll try those conversion suggestions and see if they make a difference.

Posted 95 day(s) ago

(0)
(0)
   Report Abuse
Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook