I have a job that requires me to put 12 records of a DB onto a page and to
keep doing it until I run out of records.  The number of records is
variable but in my test case, it is 30 records.  Ultimatlly, this job will
be put onto FusionPro Web, so things like external databases will not
work.

I copied David's script (thanks David) that will put multiple records on a
page.  I got it doing exactly what I need it to do with one exception. 
Using my 30 record database, it never outputs the 3rd page.  (If I add 6
records to the DB, it will output a 3rd page.)

Any weekend worriers out there that can give me a hand with my script?

//OnJobStart
My_Last = new Array([11])
My_First = new Array([11])
My_City = new Array([11])
My_State = new Array([11])
return "";




// OnRecordStart
// Setup for arrays and imposing 12-up in FusionPro.
// I separate output into blocks of 12 and turn on
// a "slipsheet" page to printout a header for each.

// Turned off because I do not need a slipsheet.
//var RecIndex = CurrentRecordNumber() % 12
//if (RecIndex == 12)
//{
//FusionPro.Composition.SetBodyPageUsage("SlipSheet",true)
//}
//else
//{
//FusionPro.Composition.SetBodyPageUsage("SlipSheet",false)
//}

// Clear out or set array index value for current record. If the
// mod calc return a 1 then it is a beginning of a new page and
// the array should be cleared. MyCalc is the array index value.

var MyCalc = CurrentRecordNumber() % 12

if (MyCalc == 1) // Test for Top page element
{
for (x=0; x<=11; x++) // Loop thru and clear all elements
{
My_Last[x] = ""
My_First[x] = ""
My_City[x] = ""
My_State[x] = ""
}
}

// Add the current record to the array.

My_Last[MyCalc] = Field("Last")
My_First[MyCalc] = Field("First")
My_City[MyCalc] = Field("City")
My_State[MyCalc] = Field("State")

// Turn on the page only when the 12th element is processed.

if (MyCalc == 0)
{
FusionPro.Composition.SetBodyPageUsage("Scorecard",true)
}
else
{
FusionPro.Composition.SetBodyPageUsage("Scorecard",false)
}

return "";


--
Users of FusionPro Desktop have unlimited free email support. Contact Printable 
Support at [EMAIL PROTECTED] 
--
View FusionPro Knowledge Base, FusionPro Samples at
www.printable.com/vdp/desktop.htm

--
You are currently subscribed to fusionpro as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
--


--
Note:  All e-mail sent to or from this address will be received or otherwise 
recorded by the e-mail recipients of this forum. It is subject to archival, 
monitoring or review by, and/or disclosure to someone other than the recipient. 
Our privacy policy is posted on www.printplanet.com
--

Reply via email to