Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 13th, 2021, 08:19 AM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 35
Default Running Data File Multiple Times???

I've got an interesting situation. I really thought I would find something similar on the forum, but I wasn't able to find anything.

I have an 8-page (4-sheets duplexed) court document that will have variable data on the front sides. It's really just a 1-sheet (2-pages duplexed) job that is replicated 3 more times. The first four pages are printed on 2-sided 2-part carbonless paper and will be sent to the court for signatures. 1-part for the court, 1-part for the defendant. The other pages are all going to be mailed out and will be printed on plain paper. One 2-sided sheet to the plaintiff and one 2-sided sheet to the defendant.

The customer is wanting this to basically print to three different stacks.

Stack 1
is the first 4 pages which will be printed on carbonless paper. Bottom of page one is marked "Court", bottom of page 3 is marked "Plaintiff".

Stack 2
is pages 5-6 being mailed to the Defendant. Bottom of page 5 is marked "Defendant".

Stack 3
is pages 7-8 being mailed to the Plaintiff. Bottom of page 7 is marked "Plaintiff"

All of the sheets contain the same data except the bottom of the pages are marked for who they are for.

Sorry for how long this is....I'm just trying to get as much info as possible into the original post.

So if I have a datafile with 80 court records I will have:
160 Carbonless sheets in stack 1
80 Plain paper sheets in stack 2
80 Plain paper sheets in stack 3

How can I get the FusionPro to compose the datafile multiple times?

Thanks in advance everyone!
Reply With Quote
  #2  
Old January 14th, 2021, 09:38 AM
crabtreed crabtreed is offline
Forum n00b
 
Join Date: Jul 2012
Posts: 3
Default Re: Running Data File Multiple Times???

Troy
I have solution to the problem you posted. This will go through the data as an external data source. It will parse and array for the Page Usage and an array for file names that is in Global Variables.

Using;


ON JOB START
pages = ['CourtFNCR' , 'CourtBkNCR' , 'DefFNCR' , 'DefBkNCR' , 'DefFPln' , 'DefBkPln' , 'DefBkPln' , 'PlntfFPln' , 'PlntfBkPln'];
jobs = ['Court', 'Def', 'Plain'];
FusionPro.Composition.composeAllRecords = false;
FusionPro.Composition.endRecordNumber = pages.length;
GLOBALS
pages = ['CourtFNCR' , 'CourtBkNCR' , 'DefFNCR' , 'DefBkNCR' , 'DefFPln' , 'DefBkPln' , 'DefBkPln' , 'PlntfFPln' , 'PlntfBkPln'];
jobs = ['Court', 'Def', 'Plain'];
ON RECORD START
var ex = new ExternalDataFileEx(PrimaryInputFile(), "EXCEL");
FusionPro.Composition.repeatRecordCount = ex.recordCount;
PreviewJobVal = FusionPro.Composition.isPreview;
if(PreviewJobVal == true)
{
FusionPro.Composition.SetBodyPageUsage(1, true);
FusionPro.Composition.SetBodyPageUsage(2 , true);
FusionPro.Composition.SetBodyPageUsage(3 , true);
FusionPro.Composition.SetBodyPageUsage(4 , true);
FusionPro.Composition.SetBodyPageUsage(5 , true);
FusionPro.Composition.SetBodyPageUsage(6 , true);
FusionPro.Composition.SetBodyPageUsage(7 , true);
FusionPro.Composition.SetBodyPageUsage(8 , true);
} else {

var pg = pages[FusionPro.Composition.inputRecordNumber-1]; // reads length of array pages
var jobout = jobs[FusionPro.Composition.inputRecordNumber-1]; //reads length of array jobs
//var output = GetFileName(PrimaryInputFile()).replace(/\..+$/,'') +
// '_' + jobout+ '.' + FusionPro.Composition.outputFormatExtension; This was original and names the files after input file and added some number. I removed it.
var output = (jobout+ '.' + FusionPro.Composition.outputFormatExtension); //creates the files for pages
//var output = ("/Users/decrabtree/Documents/FP_Jobs/" + jobout + '.' + FusionPro.Composition.outputFormatExtension); // This will place a file in a hot folder.

for( job in jobout){
if (FusionPro.Composition.repeatRecordNumber == 1)
//FusionPro.Composition.OpenNewOutputFile(FusionPro. Composition.OpenNewOutputFile("/Users/decrabtree/Documents/" + jobout +"/" + output)); // This will place the files in a folder named after the jobout Files i.e.Courts/Courts.pdf
FusionPro.Composition.OpenNewOutputFile(output);
for (var i in FusionPro.Fields)
FusionPro.Composition.AddVariable(i, ex.GetFieldValue(FusionPro.Composition.repeatRecor dNumber, i));
switch (jobout){

case "Court":
FusionPro.Composition.SetBodyPageUsage(1 , true);
FusionPro.Composition.SetBodyPageUsage(2 , true);
FusionPro.Composition.SetBodyPageUsage(3 , true);
FusionPro.Composition.SetBodyPageUsage(4 , true);
break;
case "Def":
FusionPro.Composition.SetBodyPageUsage(5 , true);
FusionPro.Composition.SetBodyPageUsage(6 , true);
break;
case "Plain":
FusionPro.Composition.SetBodyPageUsage(7 , true);
FusionPro.Composition.SetBodyPageUsage(8 , true);
break;

}
}
}

Last edited by crabtreed; January 21st, 2021 at 05:27 PM.. Reason: additional fixes
Reply With Quote
  #3  
Old January 14th, 2021, 01:09 PM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 35
Default Re: Running Data File Multiple Times???

Thanks Dan, that works perfectly!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:54 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.