Print Page | Close Window

Adding "*" to either side of a partnumber

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3170
Printed Date: 04 May 2024 at 9:44pm


Topic: Adding "*" to either side of a partnumber
Posted By: rookers
Subject: Adding "*" to either side of a partnumber
Date Posted: 14 May 2008 at 7:17am
Hi there. Brand new to the forum. Looks really useful. Also brand new to Crystal Reports and am struggling with something very basic.
 
On a report I am displaying a part-number.  Underneath that part-number I want to display the same field again but in a bar-code font.  No problem.
 
Except that to get the barcode reader to read the partnumber correctly, it has to have an asterix either side of it. 
 
So my question is, how do I create a forumla or field or something that will take my field (part-number) and place a "*" either end of it ?
 
Any help on this much appreciated.  Sorry if this is a dumb question but it has kept me going all day before finding this forum.
 
Cheers
Jez
 



Replies:
Posted By: hilfy
Date Posted: 14 May 2008 at 9:45am
Yes, you'll create a formula for this.  What is the field type of your part number field in the database?  If it's an alphanumeric, this is easy.  Your formula will look like:
 
'*' + {table.partnumber} + '*'
 
If the field is a number field, you'll have to convert the number to a string using the ToText function like this:  ToText({table.partnumber}, 0) - the ",0" tell ToText to not include any decimal.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: rookers
Date Posted: 15 May 2008 at 5:34am
Many thanks indeed.
That worked.
 
Thanks for your help.


Posted By: gloverca
Date Posted: 26 Sep 2008 at 10:31pm
I was reading your post looking to an answer to a problem that I have, please, reply.
 
I am using vb application to pass parameters to a crystal X report on the fly, one of the parameters is used in a formula to create the code 39 barcode ( using the free 3 of 9 code) ( '*' & {?strBarcode2} & '*'.
 
If I use Crystal to see the report it shows fine, including the * at start/end. but when I run the application the * are deleted from the barcode, so they can not be scanned anymore. I have read some replies about MS using * for bolds. do yo know how to fix this problem for crystal?
 
pretty please, reply if you know.
 
regards.


Posted By: hilfy
Date Posted: 28 Sep 2008 at 9:04am
Are you running the application on the same computer where you're running Crystal?  If not, have you installed the font on the computer where the application is running?
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: gloverca
Date Posted: 28 Sep 2008 at 12:41pm
yes, I have CR X, the VB App and the font (free 3 of 9) installed in the same computer.
If I use the font in CR it shows OK, the problem arises when I pass the parameters to the report from VB.


Posted By: hilfy
Date Posted: 29 Sep 2008 at 7:20am
I suggest putting both the parameter and the formula where you add the asterisks on the report in plain text for testing.  Then run it from your application.  That way you can see what it looks like before you add the barcode font.  This should help you troubleshoot it.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: gloverca
Date Posted: 29 Sep 2008 at 7:39am
I have done so, putting the parameter and the formula in the report.
lets call them strBarcode1 (times new roman) and strBarcode2 (free 39 with the formula). if I change the barcode2 to times new roman it shows the *, but when I change it back to 39 they are removed.
If I do this excersize using CR X they print fine and I am able to see the * in the barcode2. only when I pass the parameters they disappear.
I tried having barcode1 and barcode2 as parameters and passing the formatted string from the VB app. to the report and they do the same thing again.
I am using CrystalActiveXReportViewer in my vb form.
regards
 


Posted By: gloverca
Date Posted: 29 Sep 2008 at 7:43am
this is how I am passing the parameters to the report
CR_Report.ParameterFields.GetItemByName("strBarcode1").ClearCurrentValueAndRange
    CR_Report.ParameterFields.GetItemByName("strBarcode1").AddCurrentValue tag_strBarcode1
    CR_Report.ParameterFields.GetItemByName("strBarcode2").ClearCurrentValueAndRange
    CR_Report.ParameterFields.GetItemByName("strBarcode2").AddCurrentValue tag_strBarcode2
 
where tag_strBarcode1 and tag_strBarcode2 are the parameters passed to the report.


Posted By: hilfy
Date Posted: 29 Sep 2008 at 7:59am

At this point, I'm not sure what the problem might be.  Have you applied all of the available updates to both Crystal and Visual Studio?

-Dell



-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: gloverca
Date Posted: 05 Oct 2008 at 7:24pm
I have all the updates and still is not working. any ideas on how to debug this problem?
regards
g


Posted By: hilfy
Date Posted: 06 Oct 2008 at 7:40am
Since the parameters are coming through with the asterisks, which you've verified by displaying them in plain text, the only other thing I can think of is that  the website or Visual Studio aren't seeing the font correctly.  I haven't done any work with bar codes, so I don't have any thoughts about debugging beyond what I've already mentioned.
 
I suggest creating a new topic in the forum here, titled something like "Barcode Issue" and explain everything there, including the plain text test that you ran to be sure that the asterisks were there.  In the forum here, once one of the folks who regularly answers questions here starts working with a topic, the other folks who answer questions frequently will not check that thread so this would be a good way to get attention from someone who has specifically worked with barcodes.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window