Jump to content

Slipsheet on data change


dreimer

Recommended Posts

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.
Link to comment
Share on other sites

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");
}

Link to comment
Share on other sites

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();

Link to comment
Share on other sites

  • 5 months later...
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();

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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...