PDA

View Full Version : Slipsheet on data change


dreimer
April 3rd, 2013, 11:06 AM
So I am trying to set up a template where my unused slipsheet page will be inserted when the data changes in a field such as "Image". The number of records per "Image" will vary, but I will have the repeats built into the data file used so I don't need to use the RepeatRecord Function. I think it would neded to be an OnRecordStart rule, but not sure. Also, this will be one-up so no imposition file will be used. Is this possible with my current version of Fusion Pro? Any help would be great, TIA.

step
April 3rd, 2013, 11:35 AM
You probably want to do something like this:

JavaScript Globals:

var img = "";


OnRecordStart:

if (img != Field("Image")){
FusionPro.Composition.SetBodyPageUsage("Slipsheet",true);
img = Field("Image");
}

dreimer
April 3rd, 2013, 11:41 AM
Perfect, thank you Step. Love this forum!!!!!!!!!

Dan Korn
April 3rd, 2013, 02:01 PM
You probably want to do something like this:

JavaScript Globals:

var img = "";
OnRecordStart:

if (img != Field("Image")){
FusionPro.Composition.SetBodyPageUsage("Slipsheet",true);
img = Field("Image");
}

Actually, in FusionPro 8.0, it's even simpler, without requiring anything in the JavaScript Globals:
if (FieldChanged("Image"))
FusionPro.Composition.SetBodyPageUsage("Slipsheet", true);Or, even more succinctly:
FusionPro.Composition.SetBodyPageUsage("Slipsheet", FieldChanged("Image"));Also, you can set the slip sheet arbitrarily like this even if you are using imposition, by setting the slip sheet to start at the beginning of a stack in the Composition Settings, and then starting a new stack like so in OnRecordStart:
if (FieldChanged("Image"))
FusionPro.Composition.StartNewStack();

step
April 3rd, 2013, 02:25 PM
Very true though his signature said he was running FP7.2 ;)

marcuslayton
September 24th, 2013, 02:11 PM
can this:

if (FieldChanged("Image"))
FusionPro.Composition.StartNewStack();
be used when using a repeat record count - something like this:

FusionPro.Composition.repeatRecordCount = Field("RunQty");
FusionPro.Composition.StartNewStack();

?

Dan Korn
September 24th, 2013, 04:33 PM
can this:

if (FieldChanged("Image"))
FusionPro.Composition.StartNewStack();
be used when using a repeat record count - something like this:

FusionPro.Composition.repeatRecordCount = Field("RunQty");
FusionPro.Composition.StartNewStack();
?
Sure, but with that code, you'll get each output record in its own stack. You still need to tell it to start a new stack only when the input data changes. This should work:

FusionPro.Composition.repeatRecordCount = Field("RunQty");
if (FieldChanged("Image"))
FusionPro.Composition.StartNewStack();
Or, since you're repeating, if you want each input record to go to its own stack, you could do this:

FusionPro.Composition.repeatRecordCount = Field("RunQty");
if (FusionPro.Composition.repeatRecordNumber == 1)
FusionPro.Composition.StartNewStack();

DCS
January 15th, 2014, 02:22 PM
So how would I get a slip sheet before every file written using this code

if (FieldChanged("WelcomePackageCode"))
{
outpath = "c:\\Files\\Jan 14 Kits\\Mailing\\FS Labels\\" + Field("WelcomePackageCode") + "\\";
filename = Field("WelcomePackageCode");
outfile = outpath + filename;

FusionPro.Composition.OpenNewOutputFile(outfile + "." + FusionPro.Composition.outputFormatExtension);

}

Also, Can I get the slipsheet to impose like the rest of the file

thanks
Mike

Dan Korn
January 15th, 2014, 03:23 PM
So how would I get a slip sheet before every file written using this code

if (FieldChanged("WelcomePackageCode"))
{
outpath = "c:\\Files\\Jan 14 Kits\\Mailing\\FS Labels\\" + Field("WelcomePackageCode") + "\\";
filename = Field("WelcomePackageCode");
outfile = outpath + filename;

FusionPro.Composition.OpenNewOutputFile(outfile + "." + FusionPro.Composition.outputFormatExtension);

}
This is pretty much what we've been talking about in the rest of this thread. Just add a call to FusionPro.Composition.StartNewStack() in there, and in the Composition Settings, under Imposition, make sure you have the slip sheet set to be output at the beginning of a stack.
Also, Can I get the slipsheet to impose like the rest of the file
I don't understand the question. If the sheet is imposed with the rest of the output pages, then it's not really a slip sheet, by definition. If that's what you want to do, then forget about slip sheets, and just call out an Unused Body Page, like so:
FusionPro.Composition.SetBodyPageUsage("slipsheet", FieldChanged("WelcomePackageCode"));Which was basically what I said in my first post in this thread (http://forums.pti.com/showpost.php?p=12752&postcount=4).

DCS
January 15th, 2014, 07:19 PM
I had already tried adding the
FusionPro.Composition.StartNewStack()

didin't work...

Is there a place I should put it (within the brackets, outside)?

I will try your 2nd suggestion... where should I put that?

Thanks
Mike

Dan Korn
January 16th, 2014, 09:12 AM
I had already tried adding the
FusionPro.Composition.StartNewStack()

didin't work...
You have to be using stacked imposition, for one thing. And you have to have the setting I mentioned in the Composition Settings.

Anyway, it's hard to answer these kinds of questions in the abstract without knowing more about the particulars of the job.
Is there a place I should put it (within the brackets, outside)?
Yes, inside the brackets, so you get a new stack, and a slip sheet, when the field value changes.
I will try your 2nd suggestion... where should I put that?
All of these examples would go in OnRecordStart.