Author |
Message |
rookers
Newbie
Joined: 14 May 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
|
Topic: Adding "*" to either side of a partnumber 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
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
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
|
|
IP Logged |
|
rookers
Newbie
Joined: 14 May 2008
Location: United Kingdom
Online Status: Offline
Posts: 2
|
Posted: 15 May 2008 at 5:34am |
Many thanks indeed.
That worked.
Thanks for your help.
|
IP Logged |
|
gloverca
Newbie
Joined: 26 Sep 2008
Location: Canada
Online Status: Offline
Posts: 5
|
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.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
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
|
|
IP Logged |
|
gloverca
Newbie
Joined: 26 Sep 2008
Location: Canada
Online Status: Offline
Posts: 5
|
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.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
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
|
|
IP Logged |
|
gloverca
Newbie
Joined: 26 Sep 2008
Location: Canada
Online Status: Offline
Posts: 5
|
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
|
IP Logged |
|
gloverca
Newbie
Joined: 26 Sep 2008
Location: Canada
Online Status: Offline
Posts: 5
|
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.
|
IP Logged |
|
hilfy
Admin Group
Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
|
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
|
|
IP Logged |
|
|