Solved

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

Posted on 2013-12-27
2
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 101

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 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