Jump to content

Ability to compare record to next record in data source


Recommended Posts

I would like to be able to compare a field value in one record in my data source to see if it equals the value of that field in the next record in my data source. I would like to continue this comparison till the field value changes. The goal is to extract into each PDF letter all the rows that have the same field value in column one. So...instead of variable information coming from one record, I want to combine variable information from multiple rows (records) where a specific field value is the same. Has anyone done this?
Link to comment
Share on other sites

Is there any hope of doing this is we are still using version 4.2?

No. Well, at least not if you're really trying to output to multiple files. The ability to open a new output file at any given time ("arbitrary chunking") is new in FusionPro 8.0. In earlier versions, you could chunk the output to multiple files, but all the chunks (other than the first and last) had to be the same size (same number of records). The only way to do what I think you're trying to do in those older versions is to break up the input file and do multiple compositions.


However, if what you're trying to do is aggregate all the records from the data into a single output record, you can do that by opening the data file with ExternalDataFileEx, then you can iterate through it and do pretty much whatever you want. This should work even in older versions.


At any rate, you should really consider upgrading. FusionPro 4.2 is five years old. It predates the very first iPhone. :eek:

Link to comment
Share on other sites

  • 1 month later...
Can the same idea be used to turn on an unused body page when a field changes?


if (FieldChanged(Field("fieldname")))

FusionPro.Composition.SetBodyPageUsage("test", true);


Its not working for me, but I just thought it might be useful if it could.

Yes, that idea should work in general. But your first line is wrong; you don't want to call the Field function inside the FieldChanged() call. I highlighted the parts you need to remove above in Red.


So the rule should look like this:

if (FieldChanged("fieldname"))

Or, more simply, like this:

FusionPro.Composition.SetBodyPageUsage("test", FieldChanged("fieldname"));

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.

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