Jump to content

Running Data File Multiple Times???


TroyM68

Recommended Posts

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!

Link to comment
Share on other sites

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;

 

 

JavaScriptGlobals ************************************************************

pages = ['CourtFNCR' , 'CourtBkNCR' , 'DefFNCR' , 'DefBkNCR' , 'DefFPln' , 'DefBkPln' , 'PlntfFPln' , 'PlntfBkPln'];

jobs = ['Court', 'Def', 'Plain'];

 

OnJobStart*******************************************************************

FusionPro.Composition.composeAllRecords = false;

PreviewJobVal = FusionPro.Composition.isPreview;

if(PreviewJobVal ==true){

FusionPro.Composition.endRecordNumber = ex.recordCount;

}else{

FusionPro.Composition.endRecordNumber = pages.length;

}

On Record Start ****************************************************************************

 

var ex = new ExternalDataFileEx(PrimaryInputFile(), "EXCEL");

FusionPro.Composition.repeatRecordCount = ex.recordCount;

 

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 = (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.repeatRecordNumber, 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;

 

}

}

}

Edited by crabtreed
additional fixes
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...