Reputation: 1
I'm using Crystal Reports 2013 and our shipping department uses a unique serial formula to put an ID or LOT Number on outgoing shipments to customers. The formula we use was created a long time ago and has worked fine as a regular integer or converted to barcodes. The issue is that many of our customers are transitioning to matrix/QR codes for scanning information. When the current serial is added to a QR code, the serial comes out with the normal thousands, millions comma separators even though the formula uses a "" as a separator.
So 445533434 is scanned as 445,533,434.00 via QR reader. I've created other formulas using RND and StringVar, but the company wants ONLY the old serial formula which is comprised of the following formulas;
The creation of the serial number (@Serial Number):
(-(DateDiff ("s",currentdatetime,Date (2010,02,01)))/1)+{Report.ReportIDKey}
Then the formatting of the Serial Number:
right("000000" + totext({@Serial Number}, 0,""), 8)
I created my own formula, which creates a random number (Random Serial):
Rnd() * 100000
And then converts it to a single string of numbers. No commas or decimals.
StringVar text := Totext ( {@Random Serial} , 0 , "" ) ;
I tried to apply the same concept to the formatting of the old serial number:
StringVar text := Totext ( {@Serial Number}, 0,"");
And X-2 check says No Error, but the report/label just returns a blank page.
And guidance would be greatly appreciated. I'm pretty frustrated and not sure I can figure this out without asking for help.
What was tried is noted above.
Upvotes: 0
Views: 7
Reputation: 4026
The problem is probably with how the string value is used in the QR code generation.
To confirm, simply place the formula:
right("000000" + totext({@Serial Number}, 0,""), 8)
on the report layout so you can actually see the string value. If it looks correct then the problem is indeed with the QR Code logic -- not with the string value.
Upvotes: 0