#1
|
||||
|
||||
![]()
So we are trying to find a better way to run several hundred different coupon stacks. The customer wants the coupons stacked in "books" based on the number of coupons per book.
Here are the codes I have: OnJobStart Code:
FusionPro.Composition.chunksBreakStacks = true; Code:
var jobNumber = Field("Job #") + "_" + Field("BMA Name"); var jobExtension = "." + (FusionPro.Composition.outputFormatExtension || "pdf"); if (FieldChanged("BMA Name") && FusionPro.Composition.repeatRecordNumber == 1) FusionPro.Composition.OpenNewOutputFile(jobNumber + jobExtension); Code:
var strNumber = "<b><z newsize=10>N<z newsize=14><u><superscript>o</superscript></u><z newsize=12> </b>"; var bookCount = Field("# of books"); var couponPerBook = Field("# of coupons/book"); FusionPro.Composition.composeAllRecords = false; FusionPro.Composition.startRecordNumber = Field("start #"); FusionPro.Composition.endRecordNumber = Field("end #"); FusionPro.Composition.repeatRecordCount = Field("# of coupons"); return strNumber + FormatNumber ("0000", FusionPro.Composition.recordNumberInChunk); However, we now need to use the # of coupons/book to break up each part into a new book. Example: Currently we see HTML Code:
Job#_Ranch1.pdf (4000 coupons 1-4000) Job#_Ranch2.pdf (6000 coupons 1-6000) Example: We want to see Code:
Job#_Ranch1_Book1 (2000 coupons 1-2000) Job#_Ranch1_Book2 (2000 coupons 2001-4000) Job#_Ranch2_Book1 (1000 coupons 1-1000) Job#_Ranch2_Book2 (1000 coupons 1001-2000) Job#_Ranch2_Book3 (1000 coupons 2001-3000) Job#_Ranch2_Book4 (1000 coupons 3001-4000) Job#_Ranch2_Book5 (1000 coupons 4001-5000) Job#_Ranch2_Book6 (1000 coupons 5001-6000) I am assuming we need a variable "bookCount" to increase after each set so it doesn't overwrite the previous set. Attached is the original code before the OnRecordStart was updated for you to work with. Suggestions?
__________________
Audra Landis Computer Systems Admin VDP Producer v10.0.3 Windows 7 / Windows 10 Acrobat Pro DC (2015.010.20056) |
#2
|
||||
|
||||
![]() Quote:
Or is the number of coupons per chunk variable? If so, then you just need to change the condition here: Code:
if (FieldChanged("BMA Name") && FusionPro.Composition.repeatRecordNumber == 1) FusionPro.Composition.OpenNewOutputFile(jobNumber + jobExtension); Code:
if (FieldChanged("BMA Name") || FusionPro.Composition.repeatRecordNumber % couponPerBook == 1) { var couponPerBook = Field("# of coupons/book"); var jobNumber = Field("Job #") + "_" + Field("BMA Name") + "_Book" + Int((FusionPro.Composition.repeatRecordNumber-1) / couponPerBook); var jobExtension = "." + (FusionPro.Composition.outputFormatExtension || "pdf"); FusionPro.Composition.OpenNewOutputFile(jobNumber + jobExtension); }
__________________
Dan Korn FusionPro Developer / JavaScript Guru / Forum Moderator PTI Marketing Technologies | Printable | MarcomCentral I am a not a Support engineer, and this forum is not a substitute for Support. My participation on this forum is primarily as a fellow user (and a forum moderator). I am happy to provide help and answers to questions when I can; however, there is no guarantee that I, or anyone else on this forum, will be able to answer all questions or fix any problems. If I ask for files to clarify an issue, I might not be able to look at them personally. I am not able to answer private messages, emails, or phone calls unless they go through proper Support channels. Please direct any sales or pricing questions to your salesperson or inquiries@marcom.com. Complex template-building questions, as well as all installation and font questions or problems, should be directed to FusionProSupport@marcom.com. Paid consulting work may be required to fulfill your template-building needs. This is a publicly viewable forum. Please DO NOT post fonts, or other proprietary content, to this forum. Also, please DO NOT post any "live" data with real names, addresses, or any other personal, private, or confidential data. Please include the specific versions of FusionPro, Acrobat, and your operating system in any problem reports or help requests. I recommend putting this information in your forum signature. Please also check your composition log (.msg) file for relevant error or warning messages. Please post questions specific to the MarcomCentral Enterprise and Web-to-Print applications in the MarcomCentral forum. Click here to request access. Or contact your Business Relationship Manager (BRM/CPM) for assistance. Please direct any questions specific to EFI's Digital StoreFront (DSF) to EFI support. How To Ask Questions The Smart Way The correct spellings are JavaScript, FusionPro, and MarcomCentral (each with two capital letters and no spaces). Acceptable abbreviations are JS, FP, and MC (or MCC). There is no "S" at the end of "Expression" or "Printable"! The name of the product is FusionPro, not "Fusion". "Java" is not is not the same as JavaScript. Check out the JavaScript Guide and JavaScript Reference! FusionPro 8.0 and newer use JavaScript 1.7. Older versions use JavaScript 1.5. return "KbwbTdsjqu!spdlt\"".replace(/./g,function(w){return String.fromCharCode(w.charCodeAt()-1)}); ![]() |
#3
|
||||
|
||||
![]() Quote:
So now I see: Code:
Job#_Ranch1_Book0 2000 coupons (1-2000) Job#_Ranch1_Book1 2000 coupons (1-2000) Code:
Job#_Ranch1_Book0 2000 coupons (1-2000) Job#_Ranch1_Book1 2000 coupons (2001-4000)
__________________
Audra Landis Computer Systems Admin VDP Producer v10.0.3 Windows 7 / Windows 10 Acrobat Pro DC (2015.010.20056) |
#4
|
||||
|
||||
![]()
Nevermind! I just had to eat some breakfast.
I used your book separating method and changed the couponNumber rule: Old Rule Code:
var strNumber = "<b><z newsize=10>N<z newsize=14><u><superscript>o</superscript></u><z newsize=12> </b>"; FusionPro.Composition.composeAllRecords = false; FusionPro.Composition.startRecordNumber = Field("start #"); FusionPro.Composition.endRecordNumber = Field("# of coupons"); FusionPro.Composition.repeatRecordCount = Field("# of coupons"); return strNumber + FormatNumber ("0000", FusionPro.Composition.recordNumberInChunk); Code:
var strNumber = "<b><z newsize=10>N<z newsize=14><u><superscript>o</superscript></u><z newsize=12> </b>"; FusionPro.Composition.composeAllRecords = false; FusionPro.Composition.startRecordNumber = Field("start #"); FusionPro.Composition.endRecordNumber = Field("# of coupons"); FusionPro.Composition.repeatRecordCount = Field("# of coupons"); return strNumber + FormatNumber ("0000", FusionPro.Composition.repeatRecordNumber); Thanks! ^^,
__________________
Audra Landis Computer Systems Admin VDP Producer v10.0.3 Windows 7 / Windows 10 Acrobat Pro DC (2015.010.20056) |
![]() |
Tags |
chunk, coupons, record number, repeatrecordnumber |
Thread Tools | Search this Thread |
Display Modes | |
|
|