Solved

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

Posted on 2013-12-27
2
454 Views
Last Modified: 2013-12-27
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
Comment
Question by:tparus
2 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
Comment Utility
Try this

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

mlmcc
0
 

Author Closing Comment

by:tparus
Comment Utility
Perfect! Thanks for you help with this.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now