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 January 28th, 2009, 05:51 AM
LeberMac's Avatar
LeberMac LeberMac is offline
Junior Community Member
 
Join Date: Jan 2009
Location: Milwaukee, WI
Posts: 25
Arrow How to compose a range of records?

Let's say that, through the course of a normal variable-data newsletter operation, some of the newsletters get mangled in the tabber after another flawless print run out of FusionPro. Or they get crushed in the folder/creaser. Or they get trimmed wrong. So, say in a 1,000-record job, I need to reprint records 2, 345-351, 657, and 987-998.

Is there an easy way to print a complex range of records in FusionPro? All I get in the Composition Settings Dialog box for Input is
[ ] ALL; or,
[ ] ____ to ____.

As it stands now, if I had the problem in the example above, I'm composing 4 files, one for 2, one for 345-351, one for 657, and one for 987-998, then I'm combining those all into one PDF file for reprinting.

I'm thinking that there's GOT to be a better way to do this. I can go back in and edit my source CSV file, and then save it as the "repairs" file, but that's a kludge.

I would LOVE to be able to specify a range of records to print, just like printing pages from InDesign or Quark XPress. In a multi-page document, I can specify printing pages: 2, 345-351, 657, 987-998. And it will print JUST those pages.

If there's NOT a way to do this currently, can I humbly submit this for a feature request in future versions? (Like 6.1 ?)

Thanks!
__________________
"I say we take off and nuke the entire site from orbit. It's the only way to be sure."
Reply With Quote
  #2  
Old January 29th, 2009, 05:48 AM
DSweet's Avatar
DSweet DSweet is offline
Senior Contributor
 
Join Date: Sep 2008
Location: Oberlin, Ohio
Posts: 240
Default Re: How to compose a range of records?

I haven't tried to do this, but I think you should be able to do it within an OnRecordStart rule. It would be a pretty conveluded "if-else" statement and combine this a "FusionPro.Composition.composeThisRecord = false;" and you should be able to specify a range that you want. However, it wouldn't be in the actual composition menu, you would have to compose the entire file to do this - or at least enough to cover your range values.

FusionPro.Composition.composeThisRecord = false;

If (CurrentRecordNumber() == 2) {
...FusionPro.Composition.composeThisRecord = true;
}
else if ((CurrentRecordNumber() >= 345) && (CurrentRecordNumber() <= 351)) {
...FusionPro.Composition.composeThisRecord = true;
}
else if ..... and so on

This way you only turn on the value to compose that specific record if it is within your range values in the if statements.
Good Luck
__________________
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
  #3  
Old January 29th, 2009, 06:11 AM
LeberMac's Avatar
LeberMac LeberMac is offline
Junior Community Member
 
Join Date: Jan 2009
Location: Milwaukee, WI
Posts: 25
Default Re: How to compose a range of records?

Heh, thanks, Dave!

I suppose I could write a giant if...then loop for every time I have to create a repairs file, but in reality it will be easier to just edit the .csv data file that gets imported. (And then compose JUST the records that need to be reprinted.)

So... hey - maybe Printable could put this feature request on the fast track for inclusion in 6.1?

... maybe?

__________________
"I say we take off and nuke the entire site from orbit. It's the only way to be sure."
Reply With Quote
  #4  
Old January 29th, 2009, 04:32 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,331
Default Re: How to compose a range of records?

Quote:
Originally Posted by LeberMac View Post
I suppose I could write a giant if...then loop for every time I have to create a repairs file, but in reality it will be easier to just edit the .csv data file that gets imported. (And then compose JUST the records that need to be reprinted.)

So... hey - maybe Printable could put this feature request on the fast track for inclusion in 6.1?
Well, we'll certainly be glad to consider any new feature or enhancement requests, but I can't say what the priority of any given request will be. I'm not sure how many customers would make use of such a feature.

Quote:
Originally Posted by DSweet View Post
FusionPro.Composition.composeThisRecord = false;

If (CurrentRecordNumber() == 2) {
...FusionPro.Composition.composeThisRecord = true;
}
else if ((CurrentRecordNumber() >= 345) && (CurrentRecordNumber() <= 351)) {
...FusionPro.Composition.composeThisRecord = true;
}
else if ..... and so on

This way you only turn on the value to compose that specific record if it is within your range values in the if statements.
That will certainly work, but there are definitely more succinct ways to accomplish this kind of thing in JavaScript. First off, you can certainly replace all those multiple "if/else" blocks with a few uses of the || ("or") operator, like so:
Code:
FusionPro.Composition.composeThisRecord = (CurrentRecordNumber() == 2) ||
 ((CurrentRecordNumber() >= 345) && (CurrentRecordNumber() <= 351)) ||
 ((CurrentRecordNumber() >= 987) && (CurrentRecordNumber() <= 998));
return FusionPro.Composition.composeThisRecord;
But we can simplify this further by using a local variable, like so:
Code:
var val = CurrentRecordNumber();
FusionPro.Composition.composeThisRecord = (val == 2) ||
 ((val >= 345) && (val <= 351)) ||
 ((val >= 987) && (val <= 998));
return FusionPro.Composition.composeThisRecord;
HINT: Hitting Ctrl+F in the Rule Editor will bring up a Find/Replace dialog. Or, in FusionPro 6.0, there's a handy "Find..." button you can click.

Also, you can use the Building Blocks dialog to iterate through the records and test to make sure that the result is what you want for each record. That's why we're returning the value at the end. You could also use the Print statement to write a message to the log file for each record saying what the result is.

Still, this logic can be generalized even further. Consider this:
Code:
 
function CheckRanges(val)
{
  switch (val)
  {
    case 2:
    case 657:
    // etc.
      return true;
  }
 
  switch (true)
  {
    case (val >= 345 && val <= 351):
    case (val >= 987 && val <= 998):
    // etc.
      return true;
  }
 
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
You can see that adding more ranges is just a matter of adding "case" lines to the appropriate "switch" statement. (I didn't invent the "switch (true)" trick, but it's cool!)

But wait, there's more! If you order now, you also get this:
Code:
 
var ranges = [ 2, [345,351], 657, [987,998] ];
function CheckRanges(val)
{
  for (var i in ranges)
  {
    if (ranges[i] instanceof Array)
    {
      if (val >= ranges[i][0] && val <= ranges[i][1])
        return true;
    }
    else if (val == ranges[i])
      return true;
  }
 
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
It can cut open this tin can and still slice through a tomato!

Even more succinctly:
Code:
 
var ranges = [ 2, [345,351], 657, [987,998] ];
function CheckRanges(val)
{
  for (var i in ranges)
    if (val == ranges[i] || ((ranges[i] instanceof Array) && val >= ranges[i][0] && val <= ranges[i][1]))
      return true;
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
So, all you need to do to modify the ranges you want to recompose is to change this single line:
Code:
var ranges = [ 7, [15,34], [75,83] ]; //etc.
I can't imagine any enhancement to the GUI that would be any simpler than that.

This kind of thing is exactly why we provide a JavaScript-based rules subsystem with hooks into the composition engine, so that you can do whatever job-specific thing you want to do with a few lines of code, instead of us having to implement dozens of custom dialogs to do a small subset of what some customers might want.
__________________
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
  #5  
Old January 30th, 2009, 01:32 PM
LeberMac's Avatar
LeberMac LeberMac is offline
Junior Community Member
 
Join Date: Jan 2009
Location: Milwaukee, WI
Posts: 25
Default Re: How to compose a range of records?

WOW - thanks, Dan!

... I'm imagining Dan Korn with a headset mic like Vince from ShamWOW...
"We can't do this all day.. so if you call in the NEXT 20 minutes..." Hehe.

And, to answer Dan's question of "I can't imagine any enhancement to the GUI that would be any simpler than that.", I offer you THIS gem:



Anyway, that's how I would envision it, in the Compose dialog box. A function like this would be extremely useful when running "repair" lists for, say, when a range of records of a printed mailpiece gets garbled in the diecutter after bring printed.
__________________
"I say we take off and nuke the entire site from orbit. It's the only way to be sure."
Reply With Quote
  #6  
Old January 30th, 2009, 02:45 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,331
Default Re: How to compose a range of records?

Quote:
Originally Posted by LeberMac View Post
... I'm imagining Dan Korn with a headset mic like Vince from ShamWOW...
"We can't do this all day.. so if you call in the NEXT 20 minutes..." Hehe
LOL. Actually, Alex is the one tied down to a headset all day. I'm really NOT supposed to be doing this (working the forums) all day. I'm supposed to be working on development of the product so that you guys can have new features and bug fixes and stuff like that, and so that we can entice even more new customers, all of whom will proceed to call Alex.

And if I can envision anyone here doing the ShamWOW thing, it would be our Director of Product Management, Mark Hilger. Hi Mark!
Quote:
Originally Posted by LeberMac View Post
And, to answer Dan's question of "I can't imagine any enhancement to the GUI that would be any simpler than that.", I offer you THIS gem:



Anyway, that's how I would envision it, in the Compose dialog box. A function like this would be extremely useful when running "repair" lists for, say, when a range of records of a printed mailpiece gets garbled in the diecutter after bring printed.
Yes, that's a nice enhancement. (And a nice mock-up too!)

But my point about exposing scriptable hooks instead of making new GUI elements is that this is just one of literally hundreds of enhancements that we could make to the product by coding up more dialogs, or even modifying existing ones. But there are several disadvantages to that. The main one is that changing the features in the GUI requires changing the dialogs, which we have to do here, and then we have to release a new version. And we have to make the dialogs work right on multiple platforms, which is no small feat. Scriptable components, on the other hand, are easier to add, and they can be built upon by writing new scripts without making a new release of the software.

The other problem is that, even with an enhancement like you suggest, it's still somewhat rigid. Sure, you can specify any number of abritrary ranges, but what if you wanted to do something like re-compose every fifth record, or every record where the LastName field starts with M, or every record with a particular graphic? We simply can't anticipate every possible variation that a customer might need in the future and code up another specialized dialog for it. That's why we embed the JavaScript engine, which lets you code up just about any algorithm you'll ever need. Sure, we sometimes need to add new hooks so that more things are scriptable. And of course, we don't want you to have to write a JavaScript rule to do everything, so we do try to keep things nice and WYSIWYG and point-and-clicky where we can, but ultimately scriptability provides the most flexibility. The reason you have a computer is so that you can program it to do exactly what you want it to do. At least that's my perspective as a developer.
__________________
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)});

Last edited by Dan Korn; January 30th, 2009 at 02:46 PM.. Reason: fixed Mark's title
Reply With Quote
  #7  
Old November 2nd, 2011, 11:11 AM
Stack's Avatar
Stack Stack is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Annapolis Junction, MD, USA
Posts: 105
Default Re: How to compose a range of records?

Quote:
Originally Posted by Dan Korn View Post
Well, we'll certainly be glad to consider any new feature or enhancement requests, but I can't say what the priority of any given request will be. I'm not sure how many customers would make use of such a feature.



That will certainly work, but there are definitely more succinct ways to accomplish this kind of thing in JavaScript. First off, you can certainly replace all those multiple "if/else" blocks with a few uses of the || ("or") operator, like so:
Code:
FusionPro.Composition.composeThisRecord = (CurrentRecordNumber() == 2) ||
 ((CurrentRecordNumber() >= 345) && (CurrentRecordNumber() <= 351)) ||
 ((CurrentRecordNumber() >= 987) && (CurrentRecordNumber() <= 998));
return FusionPro.Composition.composeThisRecord;
But we can simplify this further by using a local variable, like so:
Code:
var val = CurrentRecordNumber();
FusionPro.Composition.composeThisRecord = (val == 2) ||
 ((val >= 345) && (val <= 351)) ||
 ((val >= 987) && (val <= 998));
return FusionPro.Composition.composeThisRecord;
HINT: Hitting Ctrl+F in the Rule Editor will bring up a Find/Replace dialog. Or, in FusionPro 6.0, there's a handy "Find..." button you can click.

Also, you can use the Building Blocks dialog to iterate through the records and test to make sure that the result is what you want for each record. That's why we're returning the value at the end. You could also use the Print statement to write a message to the log file for each record saying what the result is.

Still, this logic can be generalized even further. Consider this:
Code:
 
function CheckRanges(val)
{
  switch (val)
  {
    case 2:
    case 657:
    // etc.
      return true;
  }
 
  switch (true)
  {
    case (val >= 345 && val <= 351):
    case (val >= 987 && val <= 998):
    // etc.
      return true;
  }
 
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
You can see that adding more ranges is just a matter of adding "case" lines to the appropriate "switch" statement. (I didn't invent the "switch (true)" trick, but it's cool!)

But wait, there's more! If you order now, you also get this:
Code:
 
var ranges = [ 2, [345,351], 657, [987,998] ];
function CheckRanges(val)
{
  for (var i in ranges)
  {
    if (ranges[i] instanceof Array)
    {
      if (val >= ranges[i][0] && val <= ranges[i][1])
        return true;
    }
    else if (val == ranges[i])
      return true;
  }
 
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
It can cut open this tin can and still slice through a tomato!

Even more succinctly:
Code:
 
var ranges = [ 2, [345,351], 657, [987,998] ];
function CheckRanges(val)
{
  for (var i in ranges)
    if (val == ranges[i] || ((ranges[i] instanceof Array) && val >= ranges[i][0] && val <= ranges[i][1]))
      return true;
  return false;
}
FusionPro.Composition.composeThisRecord = CheckRanges(CurrentRecordNumber());
return FusionPro.Composition.composeThisRecord;
So, all you need to do to modify the ranges you want to recompose is to change this single line:
Code:
var ranges = [ 7, [15,34], [75,83] ]; //etc.
I can't imagine any enhancement to the GUI that would be any simpler than that.

This kind of thing is exactly why we provide a JavaScript-based rules subsystem with hooks into the composition engine, so that you can do whatever job-specific thing you want to do with a few lines of code, instead of us having to implement dozens of custom dialogs to do a small subset of what some customers might want.

Is it possible to use the above JavaScript to also compose those record ranges as individual files? Or would that be similar to "arbitrary chunking", as described in Post #2 in this thread I previously started?
Reply With Quote
  #8  
Old November 2nd, 2011, 04:46 PM
Dan Korn's Avatar
Dan Korn Dan Korn is offline
FusionPro Senior Engineer / Forum Moderator
 
Join Date: Aug 2008
Location: Chicago, IL
Posts: 4,331
Default Re: How to compose a range of records?

Quote:
Originally Posted by Stack View Post
Is it possible to use the above JavaScript to also compose those record ranges as individual files?
No, not currently, unless each series has the same number of records.
Quote:
Originally Posted by Stack View Post
Or would that be similar to "arbitrary chunking", as described in Post #2 in this thread I previously started?
Yes, this will be possible with the new arbitrary chunking feature in FusionPro 8.
__________________
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
  #9  
Old October 9th, 2012, 03:07 PM
brians brians is offline
Junior Community Member
 
Join Date: Dec 2011
Location: Cedar Rapids, Iowa
Posts: 18
Default Re: How to compose a range of records?

I was looking for another solution and ran across this post. Any chance this feature has been added that LeberMac showed a sample of? I read the entire post and I understand the point that theres only so many things you can add but I can't imagine this not being a huges selling point to every printer in the variable print business. Almost every print job that involves finishing work results in some waste. I would use this on a daily basis for my reprints. Just throwing this out there from someone in the field.
Reply With Quote
  #10  
Old October 9th, 2012, 04:03 PM
step's Avatar
step step is offline
Senior Contributor
 
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 955
Default Re: How to compose a range of records?

No, that feature was not added to the latest version of FP and I don't get the impression from the prior posts that they had/have any intention of doing so.

However, with the latest version of the software, you are capable of accomplishing everything discussed in thread - including the arbitrary chunking of reprint records via JavaScript coding.
__________________
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

LinkedIn
Reply With Quote
Reply

Tags
compose, non-consecutive records, print range, range of records

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 07:05 AM.


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