Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 490
  • Last Modified:

Parse field in Crystal Reports for a Barcode created by idautomation code

I have a database field in my ERP application that contains a number that needs to be parsed so that only half the number gets converted to a barcode. Unfortunately I cannot add a field with the parsed number to the report so I need to do it in the code for the Crystal report. If you need for me to paste the code into this case but really don't know how to do this. I can create a field and use SQL to parse the number but don't know how to do this in the report.

Here is the top of the code and think that if I could parse the data and place the value into a variable for  "DataToEncode" this would work.

'*********************************************************************
'*  Native Barcode Generator for Crystal Reports
'*  Version 2006
'*  Copyright, IDAutomation.com, Inc. All rights reserved.
'*  Portions of this source code and process are Patent Pending.
'*
'*  Online Tutorial: www.idautomation.com/crystal/native/
'*
'*  You may incorporate this Source Code in your application
'*  only if you own a valid license from IDAutomation.com, Inc.
'*  for the associated product and the copyright notices are not
'*  removed from the source code.
'*
'*  Distributing this source code outside your
'*  organization requires a Developer License.
'*********************************************************************
Dim DataToEncode As String
Dim BarHeight As Number
Dim N_Dimension As Number
Dim IncludeCheckDigit As Boolean

'Modify the next line to connect to the data source:
DataToEncode = {HDRXXXXDEF.PO_NO}

I am trying to create a formula using the below which I use in SQL but it keeps complaining about CHARINDEX

LEFT({HDRXXXXDEF.PO_NO}, CHARINDEX('^', oh.po_no + '^') - 1)
0
Tim
Asked:
Tim
1 Solution
 
mlmccCommented:
Try this

LEFT({HDRXXXXDEF.PO_NO}, InStr( {HDRXXXXDEF.PO_NO} + '^','^') - 1)

mlmcc
0
 
TimSr. System AdminAuthor Commented:
Perfect! Thanks for you help with this.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now