Jump to content

Helping a brother.


Fletch

Recommended Posts

Attached you will see a PDF file that has 3 columns in it. There is also a data list attached that has multiple columns. What the customer is looking for is the Center ID number and Center name to be printed side by side underneath the “Study.Earn.Redeem” wording. Then they would like the ‘First Name’ and ‘Last Name’ underneath the ‘Student Name’ and the ‘Bonus Points’ under the ‘Bonus Points’. This will reoccur until a three columns are filled. (I was able to get 48 per column at 12pt font size, Helvetica Light Condensed) The interesting part is when the Center ID changes. The list is grouped alphabetically by Center ID number. When we reach a New Center ID, they want to stop printing on the current sheet and start a New sheet. In addition, they like to be able to print a slip sheet at the beginning of each new Center (there are 312 of them) that will contain the Center name and ID number, as well as a 3 of 9 barcode that contains the Center ID number.
Link to comment
Share on other sites

Yes, it can be done with FusionPro. In the example that you posted, you have 260 records in your data. However, since you technically only want to create 2 records from that data (one record for 10062 and one record for 10280), you're going to need your data in a format that better lends itself to the output you're trying to create. You could edit the data and assign fields that correspond to each column per record or you could link to your data as an external data file and let JavaScript handle it for you.

 

The latter method will walk through each record of your input data file at the start of the job (in OnJobStart) and determine how many unique CenterID's there are in the data and set the number of records to compose to be equal to the number of unique CenterIDs:

var recs = 0;
var id = '';
var ex = new ExternalDataFileEx(FusionPro.Composition.inputFileName,'\t');
for (var i=1; i<=ex.recordCount; i++) {
   if (ex.GetFieldValue(i, 'CenterID') != id) {
       id = ex.GetFieldValue(i, 'CenterID');
       recs++;
   }
}

FusionPro.Composition.composeAllRecords = false;
FusionPro.Composition.endRecordNumber = recs;

 

Of course you'll also need a way to access that data when you're composing the job. My recommendation for that would be to create a global object or array to hold those values. You can insert the values by tweaking the OnJobStart rule above (and there are plenty of examples on the forum – one of which I posted yesterday). From there it's just a matter of referencing the global object or array for each record rather than the actual fields in FusionPro.

 

As far as the slipsheet goes, since each record will ultimately end up being a new "center," you can probably just create a "slipsheet" body page in addition to the current body page. That will make each "center" start with a slipsheet. I'm not sure what you intend to happen if the number of names and points exceeds what is able to fit on 1 sheet but my suggestion would be to duplicate your body page and use it an overflow page.

 

Anyway, that's how I would do it but hopefully that helps point you in the right direction.

Link to comment
Share on other sites

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