Solved

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

Posted on 2013-12-27
2
458 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
ID: 39742828
Try this

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

mlmcc
0
 

Author Closing Comment

by:tparus
ID: 39742882
Perfect! Thanks for you help with this.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Stored procedure 4 32
Pivot Query Problem 9 37
Passing value to a stored procedure 8 89
The remaining text does not appear to be part of the formula error 2 29
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

21 Experts available now in Live!

Get 1:1 Help Now