#48012 - 05/21/14 03:15 PM
Re: Barcode issue
[Re: strido]
|
OL Expert
Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
|
Strido,
If you want to have leading zeros, you should use the right function instead.
=right('000000'+inttostr(¤t.datapage), 6)
Hope this helps. Regards, JF This works a bit - but it puts a 1 at the end of every number. Did you properly setup your document to create multiple "Document" levels in your metadata? The field you selected is basically the ID of your "Document", and if you only have one, it will always display a 1. This can be configured in the document's properties(by double-clicking on the document's name in the Document Structure in PlanetPress Design), under the "Metadata" options. Make sure you have a condition to create new Documents in your metadata, otherwise, the value you selected will always be a 1. Regards, Raphaël Lalonde Lefebvre
|
Top
|
|
|
|
#48016 - 05/21/14 04:26 PM
Re: Barcode issue
[Re: strido]
|
OL Expert
Registered: 08/06/13
Posts: 159
Loc: MA
|
That removes the 1. Thanks! But now it's simply reverting back to dropping a zero for no apparent reason.
I'm going to open a ticket.
|
Top
|
|
|
|
#48017 - 05/21/14 04:31 PM
Re: Barcode issue
[Re: strido]
|
OL Expert
Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
|
Well, I'm looking at your string again:
=left('000000',(6-length(inttostr(¤t.datapage)))) + GetMeta('SelectedIndexInGroup[0]',1,'Job.Group.Document')
Assuming we replace it by:
=right('000000'+inttostr(¤t.datapage), 6) + GetMeta('SelectedIndexInGroup[0]',1,'Job.Group.Document')
I am still wondering why you are using "¤t.datapage" to calculate the zeroes, while you're using a metadata field. Because with this current setup, if you have a document that has 10 datapages, on the 10th datapage, you will have one less zero, because the current datapage has two digits, yet you're using the document ID, which is still at 1.
Shouldn't you be using your GetMeta in your "right" function? Something like:
=right('000000'+GetMeta('SelectedIndexInGroup[0]',1,'Job.Group.Document'), 6)
Just the "right" command and using the metadata field value instead of ¤t.datapage. Should give you something properly based on the document ID, rather than the current datapage. Sounds like it makes more sense that way.
Regards, Raphaël Lalonde Lefebvre
|
Top
|
|
|
|
#48019 - 05/21/14 04:55 PM
Re: Barcode issue
[Re: strido]
|
OL Expert
Registered: 08/06/13
Posts: 159
Loc: MA
|
I got both bits of code at a different time, and without proper training, I'm sort of just flailing and doing the trial-and-error thing. More error than anything else at this point. Perhaps it's because i have to use this code in two different places, one for the barcode and one for the "man-readable" is why I'm not getting the correct results? I am still wondering why you are using "¤t.datapage" to calculate the zeroes, while you're using a metadata field. Because with this current setup, if you have a document that has 10 datapages, on the 10th datapage, you will have one less zero, because the current datapage has two digits, yet you're using the document ID, which is still at 1. The thing that's throwing me off big time is that 25 is outputting correctly - 000025. Yet 26 is wrong, 00026.
Edited by strido (05/21/14 05:00 PM)
|
Top
|
|
|
|
|
|