IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Page 1 of 2 1 2 >
Topic Options
#47732 - 05/05/14 03:44 PM Shifting variable data
Gina Godbey Offline
OL User

Registered: 08/16/06
Posts: 93
Loc: Hickory, NC USA
I have a report that everytime it displays '<XXXXXXXX>' it should be replaced with a barcode for the 8 digit value between the brackets.

The trick is that the placement of the '<XXXXXXXX>' can vary.

I posted this last week but have not gotten a reply yet.

Top
#47736 - 05/05/14 04:48 PM Re: Shifting variable data [Re: Gina Godbey]
Benoit Potvin
Unregistered


Hi Gina,

If the barcore data is always on the same line, and if the character '<' is found only once on that line, then you could use a PlanetPress Talk expression as a custom data selection in your barcode object.


Here is an example.
Let's say the string '<XXXXXXXX>' can be found anywhere in the first line of data, between column 1 and 80. We're using a text data file (i.e. not a pdf, an xml or a database field).

Then the PlanetPress Talk expression in the barcode object could be:
Code:
=mid(@(1,1,80),pos('<',@(1,1,80))+1,8)

i.e. display the 8 characters following the first occurence of '<' in the first line of the data page.

If you want to adapt this expression for use in your own barcode object, just change @(1,1,80) to a line where the barcode value can be found.


I hope it helps!

Ben






Edited by Benoit Potvin (05/05/14 04:49 PM)

Top
#47752 - 05/07/14 02:14 AM Re: Shifting variable data [Re: Gina Godbey]
Dal Offline
OL Guru

Registered: 08/29/08
Posts: 114
Loc: UK
Please find my response to your problem in your other thread:

http://www.objectiflune.com/forum2/ubbthreads.php?ubb=showflat&Number=47691#Post47691

Top
#47767 - 05/07/14 12:23 PM Re: Shifting variable data [Re: Gina Godbey]
Gina Godbey Offline
OL User

Registered: 08/16/06
Posts: 93
Loc: Hickory, NC USA
Ben,
The barcode data line varies but it always starts in the same column.

How would that look using talk?

Top
#47771 - 05/07/14 01:50 PM Re: Shifting variable data [Re: Gina Godbey]
Dal Offline
OL Guru

Registered: 08/29/08
Posts: 114
Loc: UK
Please refer to my solution above. This will find the barcode at any position on any line.

Top
#47781 - 05/07/14 04:45 PM Re: Shifting variable data [Re: Gina Godbey]
Gina Godbey Offline
OL User

Registered: 08/16/06
Posts: 93
Loc: Hickory, NC USA
Dal,
I'm getting a PTK0197 Barcode Error : Wrong code lenght.

Top
#47783 - 05/07/14 04:54 PM Re: Shifting variable data [Re: Gina Godbey]
Dal Offline
OL Guru

Registered: 08/29/08
Posts: 114
Loc: UK
Using code 39?

Top
#47784 - 05/07/14 05:01 PM Re: Shifting variable data [Re: Gina Godbey]
Gina Godbey Offline
OL User

Registered: 08/16/06
Posts: 93
Loc: Hickory, NC USA
Yes. Is there minimum/maximum limit to digits for 39? My number is '8' digits. Will i need to add some leading zeros?

Top
#47786 - 05/07/14 05:15 PM Re: Shifting variable data [Re: Gina Godbey]
Dal Offline
OL Guru

Registered: 08/29/08
Posts: 114
Loc: UK
I tested with an 8 digit code. Actually I just buried the string <12345678> into the middle of a text file and my routine found it fine.

Can you put a data select object on your page, set the data to 'custom data selection' and type the following in the box:
Code:
=@GetBarcode()


Check that the data selection object shows the barcode value.

Are you using text data?
Did you set the Max column variable correctly (see the top of my function)? I set this to 80, however if your data is wider then that could explain why the routine doesn't find the barcode value. Which column does your barcode value appear?


Edited by Dal (05/07/14 05:17 PM)

Top
#47787 - 05/07/14 05:39 PM Re: Shifting variable data [Re: Gina Godbey]
Dal Offline
OL Guru

Registered: 08/29/08
Posts: 114
Loc: UK
Hi again,

I created a little pp7 file with my function, a sample data file (with a barcode on each page in random locations) and a single page with a barcode 39 object on it:

https://dl.dropboxusercontent.com/u/48834014/BarcodeFunction.pp7

Hope this helps.

Top
Page 1 of 2 1 2 >