Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 15th, 2014, 04:04 PM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Move to new sheet when field changes?

How would I go about beginning a new imposition sheet when a value (e.g. store number) changes? I know about FieldChanged("field_name") for arbitrary chunking, but I am not chunking output. I also saw the StartNewStack() method, but I am not stacking. I am creating a single output file with records in sequential order. Due to potentially large data files, we are trying to get by without preprocessing. I have a 36-up FPImposer template with records in data being imposed across/down each sheet before moving to next sheet. Sheets will be sent to client UN-trimmed (the sheet is kiss-cut and shipped as a full sheet of stickers).

I need to move to a new sheet when the store number changes in the data. If store 001 has 54 records, it will get one full sheet of 36 stickers and a 2nd sheet with 18 records -- the remaining 18 positions need to be blank. The 55th record (first record for store 002) begins on sheet 3.

Anyone have an idea on how to go about inserting blank records without a corresponding row of data? I'm thinking the OnRecordStart callback needs to insert (recordNumber % 36) blanks to force the next store/record to the next imposition sheet but I can't figure out how to do it.

Note: I didn't want to hijack blackbelt60's recent thread in the event our issues are different. It sounds like he is trying to do something similar.
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #2  
Old December 16th, 2014, 10:45 AM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: Move to new sheet when field changes?

Take a look at the zip file I posted here:
http://forums.pti.com/showpost.php?p=15892&postcount=2

Seems like this is what you want. Notice the Stack is set to 1 in the imposition.
Reply With Quote
  #3  
Old December 16th, 2014, 11:25 AM
dreimer dreimer is offline
Senior Contributor
 
Join Date: Oct 2010
Location: Shakopee, MN
Posts: 473
Default Re: Move to new sheet when field changes?

Hmm, I tried to look at your sample you referred to but I am unable to duplicate your output. The rules didn't come across in the zip file. I assume that is because the def file is not there.

Nevermind, figured it out! This works well!
__________________
Don Reimer - JavaScript Novice

MAC OS 10.13.6 Acrobat DC FP Creator 10.1.11
Windows 7 Acrobat X 10.1.4 FP Creator 9.3.9

Last edited by dreimer; December 16th, 2014 at 11:50 AM..
Reply With Quote
  #4  
Old December 16th, 2014, 04:05 PM
esmith's Avatar
esmith esmith is offline
Senior Contributor
 
Join Date: Oct 2008
Location: Charlotte, NC
Posts: 870
Default Re: Move to new sheet when field changes?

Thanks Thomas. I admit I looked at your thread previously and discounted it without downloading the attachment thinking I was not chunking (which to me suggests multiple output files). But after looking at your example, it is exactly what I needed and done much more "elegantly" than I was thinking would be necessary. Much appreciated.
__________________
Eric Smith
Content Developer
Classic
FP 9.3.6, MAC OSX 10.9.4, Acrobat 11.0.09
Reply With Quote
  #5  
Old September 9th, 2016, 01:33 PM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 240
Default Re: Move to new sheet when field changes?

Thomas,

I am trying your script and it works for the data file you have sent over with it. However I am trying to modify it to work with a repeatRecordCount field and it doesn't seem to be going well.

Any suggestion please?
.
__________________
David A. Sweet
Variable Data Specialist
HKM Direct Market Communications
Windows 7, Acrobat 10.x
FusionPro Desktop and Server 10.0.26
Reply With Quote
  #6  
Old September 9th, 2016, 03:06 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: Move to new sheet when field changes?

I'm not real sure what you are trying to do based on your brief description. If I had to guess, you have something like:

Red, 20
Green, 15
Blue, 32

Then you want 3 separate output files with an imposition populated with the count indicated?
Reply With Quote
  #7  
Old September 9th, 2016, 03:21 PM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 240
Default Re: Move to new sheet when field changes?

That is correct. I get an excel file with shirt orders for small, med, large, up to 6XLT. And another columns tells me how many of each shirt is needed to fulfill this specific order. I then create a label sticker for each shirt size that we send to our shirt vendor so they can count out enough and label them by size for easy picking later on. I used to just print the stickers out one after another running from sheet to sheet, but our vendor for the shirts says that is TOO COMPLICATED for them and wants each size on a separate sheet.
.
__________________
David A. Sweet
Variable Data Specialist
HKM Direct Market Communications
Windows 7, Acrobat 10.x
FusionPro Desktop and Server 10.0.26
Reply With Quote
  #8  
Old September 9th, 2016, 03:34 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: Move to new sheet when field changes?

EDIT: I think I misunderstood at first, this should work:

Code:
FusionPro.Composition.chunksBreakStacks = true;

var amount = parseInt(Field("Unit"));
FusionPro.Composition.repeatRecordCount = amount;
var rrn = FusionPro.Composition.repeatRecordNumber;

if (rrn == 1)
    FusionPro.Composition.StartNewStack();
    
FindTextFrame("Content").content = '<color name="' + Field("Group") + '">' + rrn + " of " + amount;
The CSV should look like this:

Code:
Group,Unit
Red,20
Green,15
Blue,32

Last edited by ThomasLewis; September 9th, 2016 at 03:43 PM..
Reply With Quote
  #9  
Old September 12th, 2016, 07:54 AM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 240
Default Re: Move to new sheet when field changes?

Tom,

Thank you for your suggestion, but when I tried it the pages just ran together instead of breaking apart to a new page when the size code changed. I've attached my template and a sampling of the data file. All I'm printing is the size "S", "M", "XL", etc on a label. The field OrderQty lets me know how many of that specific label I need. I've attached as well the resulting pdf file from that test run, plus the results that I came up with the hard way...compiling the records one by one and then combinging the pdf files together afterwards.
.
__________________
David A. Sweet
Variable Data Specialist
HKM Direct Market Communications
Windows 7, Acrobat 10.x
FusionPro Desktop and Server 10.0.26

Last edited by DSweet; February 8th, 2018 at 11:50 AM..
Reply With Quote
  #10  
Old September 12th, 2016, 12:09 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: Move to new sheet when field changes?

If you look back at my very first post in this thread, there is a bit of vital information there to get this to work. In the imposition, you have to set the stack to 1. I've attached a revised version of your fpi file.
Attached Files
File Type: email 85x11_30-up.fpi (3.4 KB, 3 views)
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 12:32 AM.


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