Jump to content

Multiple text frames with different data on one page


Rick J.

Recommended Posts

I'm working on a project that consists of a list of that has a ID number, date and amount. I also have 3 text frames that will hold the date and amount. Some ID numbers have more than one date and amount. I can be up to three different dates and amounts per ID number. I need each date with it's matching amount to show up individually in each text frame up to three different frames. Some ID numbers only have one, some two and some three. I only want the frames to appear when they have data, which it seems like I have that working. The problem I'm having is that when there is more than one date/amount per ID number only the first date/amount is going in all the boxes. How can I get each entry to show up in it's own frame? I have got this to work when it was all in one text frame, but I now have to return the entries each to it's own frame. I'm attaching my project to be looked at. Thanks in advance for the help.

 

Thanks,

Rick J.

 

FusionPro VDP Creator 9.3.36

Adobe Acrobat XI

Mac OS X Yosemite Version 10.10.5

FP_BenGift.zip

Link to comment
Share on other sites

The issue is that FusionPro VDP considers each line of the input data file as a record. What you are trying to do is use multiple lines of data for a single record, what we call multi-line records.

 

The simplest thing to do, by far, would be to re-work the data file to have single-file records, i.e. so that it does really only have one line per record, with field names such as "Date1", "Amount1", "Date2", "Amount2", "Date3", and "Amount3". Then you only need to apply each data field to a frame.

 

If you really do need to use multi-line records, you will still need to call out differently-named variables in the text frames, and inject those variable values from the multi-line data.

 

In FusionPro 10, all you need to do is check the "multi-line records" box in the Data Source Wizard, set the condition that triggers a new record (when the NUMBER field changes), and call FusionPro.GetMultiLineRecords() function in a rule to get a ExternalDataFileEx object containing the lines of data for the record, then iterate through those records, generally in OnRecordStart, like so:

FindTextFrame("Box0").suppress = true; 
FindTextFrame("Box1").suppress = true;
FindTextFrame("Box2").suppress = true;

//FusionPro.Composition.composeThisRecord = FieldChanged("NUMBER");
var data = FusionPro.GetMultiLineRecords();

for (var r = 1; r <= data.recordCount; r++)
{
   FindTextFrame("Box" + (r - 1)).suppress = false;
   FusionPro.Composition.AddVariable("Date" + r, data.GetFieldValue(r, "Date"));
   FusionPro.Composition.AddVariable("Amount" + r, data.GetFieldValue(r, "Amount"));
}

You'll need to go into each frame, and manually type the variable names "Date2", "Amount2", etc., in the Variable combo box to insert them into the text.

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