Jump to content

Help with variable frames


cpc

Recommended Posts

I posted this yesterday on the old listserve but didn't get any replies. Thought I would try here.

 

I have an 8.5x11 page pdf that contains two columns of text and lines. These columns are not identical. I have a csv file that contains one field per record. These are date records like this:

 

Monday, March 09, 2009

Tuesday, March 10, 2009

Wednesday, March 11, 2009

Thursday, March 12, 2009

Friday, March 13, 2009

Saturday, March 14, 2009

 

The first record in the file contains the field name. I am trying to set up two variable text frames per page, one above each column, that will allow the first date record to go above the first column and the second above the second column, etc. I keep ending up with the same record above each column on the page, then the next page will have the next record above each column and so on.

 

What am I missing? I'm using FusionPro 5.1a Windows.

 

Thanks in advance.

 

Randy Hurley

Commercial Printing & Office Supply, Inc.

17 South Third Street

P.O. Box 23

Clearfield, PA 16830

814-765-4731

Fax: 814-765-1380

cpc@clearnet.net

Link to comment
Share on other sites

Each record starts a new file/page in the template. I think you'll need a csv file with 2 fields per record, the 1st date and the 2nd date. Then you can put field 1 over column 1 & field 2 over column 2. There may be a way do do it with javascript in the rules but I don't know much about advanced rule writting yet.
Link to comment
Share on other sites

Hi Brian,

 

Thank's for the reply. Do you have any suggestions on how to seperate the records in the csv file? How can I cut every other record from field 1 and paste them into field 2?

 

I am also experimenting with linking the variable frames and changing the font size and/or frame size to get the records to fit correctly. But with the different character lengths of the records this has been a challenge.

 

Thanks again

 

Randy

Link to comment
Share on other sites

Hi Randy,

 

As Brian mentioned, FusionPro by default looks to output at least 1 page per record. Brian's suggestion of creating 2 columns of data in your input data file is a fine solution. This can be done in something like Excel - just make a second field called something like "Date2" and rearrange your data so there are 2 Dates per record. It will look something like this:

 

Date1                            Date2
Monday, March 09, 2009           Tuesday, March 10, 2009 
Wednesday, March 11, 2009        Thursday, March 12, 2009 
Friday, March 13, 2009           Saturday, March 14, 2009

Alternatively though, there is some JavaScript you can incorporate into your template to achieve the output you are after with just the single column of data in your input data file.

 

See the attached ZIP sample that demonstrates how this could be accomplished. Here's essentially the logic behind the job:

 

1) Find the total number of records in the input data file

 

2) For each record, determine if it is an even or an odd-numbered record

 

3) If an odd numbered record is being processed that IS NOT the last record in the input data, store the value of the record in a global variable. Also, "skip" the record so nothing is output by FusionPro.

 

4) If an odd numbered record is being processed that IS the last record in the data file, store the value but do NOT skip the record.

 

5) If an even numbered record is being processed, output the value of the Date field from the previous record (an odd numbered record) which has been stored as a variable along with the current record's value for the Date field.

 

This sample job shows how this logic is performed using 2 FusionPro callback rules - OnJobStart and OnRecordStart - along with the JavaScript objects/functions/properties ExternalDataFileEx, CurrentRecordNumber, and composeThisRecord.

 

There's a lot of comments in the that explain the logic in detail but there's not very much actual JavaScript so it wil hopefully be straight-forward.

 

Hope this is what you were looking for, Randy.

two_dates_example.zip

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...