Jump to content

Recommended Posts

Posted

I'm not sure why I'm having so much difficulty with this one. I'm sure the answer is obvious:

 

Working on a kiss cut label template set 4 up on a page in my template with a static background.

 

There are up to 16 available fields in the data. I need to add additional pages with the same static background when data is present in fields 5 through 16. Field 6 won't exist unless there's data in Field 5. Field 10 won't exist unless there's data in Field 5 through 9, etc.

 

I thought a basic OnRecordStart rule would work by creating a 4 page template and then enabling/disabling pages based on the presence of data in any field after #4 like this:

 

if(Field("Card5") == "")
{
FusionPro.Composition.SetBodyPageUsage("Page2", false);
FusionPro.Composition.SetBodyPageUsage("Page3", false)
FusionPro.Composition.SetBodyPageUsage("Page4", false);

if(Field("Card5") !="" && Field("Card9") =="" && Field("Card13") =="")
{
FusionPro.Composition.SetBodyPageUsage("Page2", true);
FusionPro.Composition.SetBodyPageUsage("Page3", false)
FusionPro.Composition.SetBodyPageUsage("Page4", false);
}
else
if(Field("Card5") !="" && Field("Card9") !="" && Field("Card13") =="")
{
FusionPro.Composition.SetBodyPageUsage("Page2", true);
FusionPro.Composition.SetBodyPageUsage("Page3", true);
FusionPro.Composition.SetBodyPageUsage("Page4", false);
}
else
if(Field("Card5") !="" && Field("Card9") !="" && Field("Card13") !="")
FusionPro.Composition.SetBodyPageUsage("Page2", true);
FusionPro.Composition.SetBodyPageUsage("Page3", true);
FusionPro.Composition.SetBodyPageUsage("Page4", true);
}

 

Obviously I'm way off base here.

 

Any thoughts?

Posted

Well, you could use Overflow pages, and let the composition engine decide for you when additional pages are necessary. Then you wouldn't need any code for this at all.

 

But with your current setup, I think this will work, if you initially set all the pages in question (2, 3, and 4) to be Unused in the Page Usage dialog:

FusionPro.Composition.SetBodyPageUsage("Page2", (Field("Card5"));
FusionPro.Composition.SetBodyPageUsage("Page3", (Field("Card9"));
FusionPro.Composition.SetBodyPageUsage("Page4", (Field("Card13"));

The other wrinkle here is the imposition ("4 up on a page"). Imposition requires each record to output the same number of pages. So you might be better off simply outputting all the pages, even if some are blank.

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