PDA

View Full Version : External Data File Sample - Very Simple Statement


Admin
February 4th, 2009, 02:07 PM
This sample job demonstrates the ability in the FusionPro VDP products to link to multiple additional external data files, perform a lookup in those files, and return results in the composition process.

To demonstrate this capability, the sample job is of a very simple statement that contains multiple items for each recipient.

The main input data file contains a customer name and a CustomerID field. There are 3 records in the input data file so 3 statements will be created. Here's the data in the main input data file:

Name CustomerID
Willis 123
Linda 456
Gerry 789A secondary data file also exists. This data file has the fields CID (the customer ID), Product Purchased, and Price for that product. For each customer, there can be multiple products in this secondary data file and all must be returned in a single statement for the customer. Here's the data in the secondary data file:


CID Product-Purchased Price
123 LCD TV $1495.00
123 Surround Speakers $279.00
123 Tax $141.92
456 Home Media Server $2,499.00
456 Universal Remote $50.00
456 Media Zone Network Adapter $79.99
456 Wireless Keyboard/Mouse Combo $109.00
456 Tax $219.04
789 Goo-B-Gone $9.95
789 Tax $0.77Using the FusionPro JavaScript function "ExternalDataFileEx()", this sample job does the following:



Link to the secondary data file with the purchase information in it (this is done in an OnJobStart rule)
For each record in the main input data file, find all items purchased by that customer by cross referencing the "CustomerID" field in the main input data file with the "CID" field in the secondary input data file.
Apply basic formatting to the display of the items purchased.
If the purchase item is "Tax", format it differently from the rest of the line items.

This sample has additional comments within the JavaScript code that explains the logic in greater detail.

mhilger
February 7th, 2009, 07:07 AM
Hi all,

Just a comment on this job, I wouldn't go so far as to call this a "statement" as it doesn't contain much more than a list of charges for each customer in the primary input data file.

This is a simple demonstration of the ExternalDataFileEx() method for working with secondary external data files more than anything and is some logic you certainly could use in a "real" statement (you know - along with the address of the recepient, titles on the columns of data, a "total" for the charges, and other necessary statement info).

What's the interest out there for perhaps some more complex statement type samples here in the sample jobs forum?

Allegra
August 11th, 2009, 09:22 AM
i'd like to see some more complex statement type samples here in the sample jobs forum.

-Meir Galimidi
Allegra Print and Imaging

Paul_D
October 23rd, 2009, 07:13 AM
I would like to se samples as well. Thanks.

Shawn_Eckert
October 28th, 2009, 03:32 PM
Where are all the samples?

DavidScott
December 1st, 2009, 10:19 AM
I have an application that one of my customers wants to do, which could use this but would want a total at the bottom of the statement.

Paul_D
December 1st, 2009, 10:59 AM
Yea- a sample would be great, maybe something that would list transactions and totals with logic for multiple page generation. Maybe Santa has a copy of Fusion Pro. I could put the request for transactional data samples on my Christmas list!

mhilger
December 1st, 2009, 11:05 AM
Hi all,

We have been looking at an enhancement or two specifically to make the creation of transactional jobs a bit easier with FusionPro (less coding and FusionPro tagged markup). We are currently tracking this enhancement for the next version of FusionPro - version 6.2.

Once we have this released (targeting Q1), we are looking to provide a sample that shows something a bit closer to a complete statement type job.

MHardee
December 3rd, 2009, 11:55 AM
Hi all,

We have been looking at an enhancement or two specifically to make the creation of transactional jobs a bit easier with FusionPro (less coding and FusionPro tagged markup). We are currently tracking this enhancement for the next version of FusionPro - version 6.2.

Once we have this released (targeting Q1), we are looking to provide a sample that shows something a bit closer to a complete statement type job.

Cool! This will have many uses...