#1
|
|||
|
|||
![]()
Hi All,
A client of ours presented something I've never dealt with. They are doing a series of letters, with variable data in the center of the page. The spreadsheet they sent is sorted by STORE ADDRESS and by MAILING ADDRESS. There are multiple rows of unique STORE ADDRESSES that share the same MAILING ADDRESS. It looks like these letters are going to store owners. If stores share the same owner (Mailing Address) we need to list all the corresponding STORES tied to that address in a list. I've attached a sample letter. The lines highlighted in yellow show the variable STORE text. This can range from 1-30 stores. First question: How do I write a script to pull as few as 1 or as many as 30 lines and return them on separate lines of the same letter? Second question: Some of the larger versions of this letter will flow to a second page. If I have a text box over flow, how do I suppress empty pages when they all fit on one page? I'd be happy to share more information if it helps show what we need. Thanks in advance for reading through this. Andy |
#2
|
|||
|
|||
![]()
store location:
1. you can create a rule returning the results from external table lookup scripting for the store address that matches mailing address key (id, etc)....or 2. if pre-doing the store addresses prior to fusion pro (location1+<br>+location2+<br>....etc into a field) you can create a rule to return the field checking "treat return strings as tagged text".... overflow portion: 1. you can create/insert overflow page in fusionpro so when a textbox overlow flows it uses the overflow page's text boxes that you've designated for the overflow flowed text. Last edited by tou; December 19th, 2016 at 04:10 PM.. |
#3
|
||||
|
||||
![]() Quote:
That being said, if you're using an older version (version 9 for example – because it's what I'm using), you'll need to link to your primary data file as an external data file. Then you'll want to query the data file for all records that have the same "MAILING ADDRESS" value. You'll probably want to make sure you don't compose those records again once its "STORE ADDRESS" has been associated with a mailing address so you don't end up with duplicates. You can do this by using a global variable to track which mailing addresses have been used. JavaScript Globals Code:
processed = []; Code:
FusionPro.Composition.composeThisRecord = processed.indexOf(Field("MAILING ADDRESS")) == -1; Code:
processed.push(Field("MAILING ADDRESS")); var data = new ExternalDataFileEx(PrimaryInputFile(), ','); return data .FindRecords('MAILING ADDRESS', Field('MAILING ADDRESS')) .map(function(rec){ return data.GetFieldValue(rec, 'STORE ADDRESS'); }) .filter(String) .join('<br>'); Quote:
Select the page to which you want to over flow, click edit, and change its type to "Overflow" and click "OK" Select the text box you want to overflow Select "Overflow" from the "text frame" properties window Select "Overflow text to new pages" Select the overflow page you just created in the "Page Usage" section Selecting "as few added pages as possible" in the option list under "Add pages" will give you your desired results.
__________________
Ste Pennell FusionPro VDP Creator 9.3.15 Adobe Acrobat X 10.1.1 Mac OS X 10.12 |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|