Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Tables & Charts

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old July 12th, 2017, 07:34 AM
Susan Susan is offline
Regular Contributor
 
Join Date: Oct 2008
Location: Maitland, FL
Posts: 58
Default Table rule for straddling columns

I've attached a sample of a table and was wondering if it would be possible to create a table like this where some of the entries would straddle the columns.

Here is my usual table rule where the columns don't straddle.


if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true)
{
Rule("OnJobStart");
}


//Get a count of the total number of records in the external data file
numRecsExtDF = externalDF.recordCount;

/*================================================= ============================
|| Create arrays to hold values that match the CID of the client's record
||================================================ =============================*/
var clientMatch = [];
var eventMatch = [];
var locationMatch = [];
var secMatch = [];
var rowMatch = [];
var seatMatch = [];
var qtyMatch = [];
var priceMatch = [];
var extendedMatch = [];

// Step through the external data file and push matches into their respective variables if there is a match
for (var i=1; i <= numRecsExtDF; i++) {
if (externalDF.GetFieldValue(i, 'USERACCOUNTNUMBER') == Field("USERACCOUNTNUMBER")) {
clientMatch.push(externalDF.GetFieldValue(i, 'USERACCOUNTNUMBER'));
eventMatch.push(externalDF.GetFieldValue(i, 'cEvent_Package'));
locationMatch.push(externalDF.GetFieldValue(i, 'cLocation'));
secMatch.push(externalDF.GetFieldValue(i, 'cSec'));
rowMatch.push(externalDF.GetFieldValue(i, 'cRow'));
seatMatch.push(externalDF.GetFieldValue(i, 'cSeats'));
qtyMatch.push(externalDF.GetFieldValue(i, 'TOTAL_COUNT'));
priceMatch.push(externalDF.GetFieldValue(i, 'SEAT_PRICE'));
extendedMatch.push(externalDF.GetFieldValue (i, 'EXTENDED_AMOUNT'));

}
}

/*================================================= ============================
|| Create the table
||================================================ =============================*/
new FPTable;
var myTable = new FPTable;
myTable.AddColumns(19800, 6200, 5700, 3800,6200,2650,5450,6150)
myTable.AddRows(clientMatch.length+2); // add 2 additional rows (Header and summary lines)

// HEADER ROW FORMATTING
myTable.Rows[0].Type = "Header";
myTable.Rows[0].Cells[0].Font = "Helvetica Neue Bold Condensed";
myTable.Rows[0].Cells[0].PointSize = "10";
myTable.Rows[0].Cells[0].TextColor = "White";
myTable.Rows[0].Cells[0].ShadeColor = "Black";
myTable.Rows[0].Cells[0].ShadePct = 50;
myTable.Rows[0].Cells[0].Margins = new FPTableMargins;
myTable.Rows[0].Cells[0].Margins.Top = 30;
myTable.Rows[0].Cells[0].Margins.Bottom = 45;
myTable.Rows[0].Cells[0].Margins.Right = 500;
myTable.Rows[0].Cells[0].SetBorders("Very Thin", "Gray", "Top", "Bottom", "Right", "Left");
myTable.Rows[0].CopyCells(0, 1, 2, 3,4,5,6,7); // Apply the same formating to each cell in this row
// HEADER ROW CONTENT
myTable.Rows[0].Type = "Header";
myTable.Rows[0].Cells[0].HAlign = "Left";
myTable.Rows[0].Cells[1].HAlign = "Left";
myTable.Rows[0].Cells[2].HAlign = "Center";
myTable.Rows[0].Cells[3].HAlign = "Center";
myTable.Rows[0].Cells[4].HAlign = "Center";
myTable.Rows[0].Cells[5].HAlign = "Center";
myTable.Rows[0].Cells[6].HAlign = "Center";
myTable.Rows[0].Cells[7].HAlign = "Center";
myTable.Rows[0].SetContents("Event / Package", "Location", "Sec", "Row", "Seat(s)", "Qty", "Price", "Total");

// interate through the length of the arrays (data matches from external data file) and create rows
for (var i=1; i<=clientMatch.length; i++) {
// TABLE CONTENT FORMATTING
myTable.Rows[i].Cells[0].Font = "HelveticaNeueLT Std Cn";
myTable.Rows[i].Cells[0].PointSize = "10";

myTable.Rows[i].Cells[0].Margins = new FPTableMargins;
myTable.Rows[i].Cells[0].Margins.Top = 50;
myTable.Rows[i].Cells[0].Margins.Bottom = 30;
myTable.Rows[i].Cells[0].Margins.Right = 500;
myTable.Rows[i].Cells[0].Margins.Left = 500;
myTable.Rows[i].Cells[0].SetBorders("Very Thin", "Gray", "Top", "Bottom", "Right", "Left");
myTable.Rows[i].CopyCells(0,1,2,3,4,5,6,7); // Apply the same formating to each cell in this row


// CREATE CONTENT FOR EXTERNAL DATA FILE RECORDS

myTable.Rows[i].Cells[0].VAlign = "Middle";
myTable.Rows[i].Cells[1].VAlign = "Middle";
myTable.Rows[i].Cells[2].VAlign = "Middle";
myTable.Rows[i].Cells[3].VAlign = "Middle";
myTable.Rows[i].Cells[4].VAlign = "Middle";
myTable.Rows[i].Cells[5].VAlign = "Middle";
myTable.Rows[i].Cells[6].VAlign = "Middle";
myTable.Rows[i].Cells[7].VAlign = "Middle";
myTable.Rows[i].SetContents(eventMatch[i-1], locationMatch[i-1], secMatch[i-1], rowMatch[i-1], seatMatch[i-1], qtyMatch[i-1], priceMatch[i-1], extendedMatch[i-1]);


myTable.Rows[i].Cells[0].HAlign = "Left";
myTable.Rows[i].Cells[1].HAlign = "Left";
myTable.Rows[i].Cells[2].HAlign = "Center";
myTable.Rows[i].Cells[3].HAlign = "Center";
myTable.Rows[i].Cells[4].HAlign = "Center";
myTable.Rows[i].Cells[5].HAlign = "Center";
myTable.Rows[i].Cells[6].HAlign = "Right";
myTable.Rows[i].Cells[7].HAlign = "Right";
myTable.Rows[i].SetContents(eventMatch[i-1], locationMatch[i-1], secMatch[i-1], rowMatch[i-1], seatMatch[i-1], qtyMatch[i-1], "$"+priceMatch[i-1], "$"+extendedMatch[i-1]);

}
return myTable.MakeTags();
__________________
FusionPro Creator v10.1.11 / FusionPro Producer / FusionPro Expression 3.2.2 / Mac OSX 10.13.6 / Acrobat Pro DC

Last edited by Susan; July 13th, 2017 at 10:09 AM..
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:16 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.