Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > FusionPro® VDP Creator

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 16th, 2019, 03:49 PM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 31
Default Complex Form Numbering Question

This may not be so complex for some of you, but I am having a hard time with it. Here is what I am trying to do.

I need some help with numbering a document. This document contains 4 versions of a college exam. Each exam is 14 pages within the PDF, so the total number of pages in this template is 56 pages.

On the first page of each exam is a space for the exam number, below that is the Test Form Number, which is static.

Something like this:
Page 1
Exam #: 0001
Test Form 1
Page 15
Exam #: 0002
Test Form 2
Page 29
Exam #: 0003
Test Form 3
Page 43
Exam #: 0004
Test Form 4

Then it cycles the Test Form numbers, but the exam numbering continues to escalate.

Page 1
Exam #: 0005
Test Form 1
Page 15
Exam #: 0006
Test Form 2
Page 29
Exam #: 0007
Test Form 3
Page 43
Exam #: 0008
Test Form 4

I was thinking about creating a data file that would include the number of exams the professor would like to create. That number would equal the variable “Exam #”. I know I can create a sequential numbering rule...but, how would I get that rule to work across the multiple Test Form Numbers (in this example 4 different test forms). Does anyone have any ideas on how to accomplish this? Please let me know, thanks!
Reply With Quote
  #2  
Old September 17th, 2019, 10:57 AM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,369
Default Re: Complex Form Numbering Question

I'm not quite following how this is all put together. Posting a collected template would be helpful.
__________________
Dan Korn
FusionPro Developer / JavaScript Guru / Forum Moderator
PTI Marketing Technologies | Printable | MarcomCentral
LinkedIn

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)});
Reply With Quote
  #3  
Old September 17th, 2019, 02:26 PM
ThomasLewis's Avatar
ThomasLewis ThomasLewis is offline
Senior Contributor
 
Join Date: Feb 2011
Posts: 211
Default Re: Complex Form Numbering Question

It looks like the only thing that is really variable is the Exam #.

You could create a rule that is put in a text frame on each page that looks something like this:

Code:
var form = Math.ceil(FusionPro.Composition.currentPageNumber / 14);
var exam = (FusionPro.Composition.outputRecordNumber -1) * 4;
return form + exam;
It will output just the Exam # as you iterate through each version. It is important to check the box that says "Re-Evaluate this rule for every text flow" so it will properly get the page number.

Basically what's happening here is you are getting the page number the text frame is on and dividing by 14. So page 8, for instance, would be 0.57 and then rounding that up to a 1. Page 15 would be 1.07, rounded up to 2. That takes care of your forms in the 56 page template.

Next you need the exam number but that will continue to iterate up as you go. The outputRecordNumber will keep count of that. If you start that count off with 0 instead of 1, you can multiply that by 4 to get the iteration to go up by 4 for each record. ie record 1 = 0 (0*4 = 0), record 5 = 16 (4*4 = 16), then you add the form number, making record 1 = 1-4, record 5 = 17-20, etc.
Reply With Quote
  #4  
Old September 26th, 2019, 12:33 PM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 31
Default Re: Complex Form Numbering Question

Dan, I don't think I can post the actual documents for this one because it is live test data for a University. I will try to make something and post it if needed.
Reply With Quote
  #5  
Old September 26th, 2019, 01:00 PM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 31
Default Re: Complex Form Numbering Question

Thomas, this seems to work great for the existing 56 page document. I changed it a little to be more flexible with the number of forms a professor uses and the number of pages in the exam.

var form = Math.ceil(FusionPro.Composition.currentPageNumber / Field('Pages per Form'));
var exam = (FusionPro.Composition.outputRecordNumber -1) * Field('Number of Forms');
return form + exam;


I think now the only things I need to figure out now is how to pad the exam number with zeros and how to get this to compose a certain number of exams. For example, if there are 120 students, then it composes 120 Exams (Exam # 0001 thru Exam # 0120.

Any ideas? Thanks!
Reply With Quote
  #6  
Old October 17th, 2019, 02:03 PM
TroyM68 TroyM68 is offline
Junior Community Member
 
Join Date: Mar 2016
Location: Tampa, FL
Posts: 31
Default Re: Complex Form Numbering Question

Please disregard the additional questions, I was able to figure them out. I changed the return line in the javascript to
return FormatNumber("0000", form + exam); this provided the padding I was looking for...then I opened my eyes when looking at the callback rules and found the Repeat Record Rule!
Everything is working perfectly now!

Thank You!
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 05:38 AM.


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