Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library > Formatting Text


Thread Tools Search this Thread Display Modes
Old February 12th, 2019, 11:06 AM
LyndaEngelage LyndaEngelage is offline
Junior Community Member
Join Date: Sep 2014
Posts: 43
Default Table with ampersand in data

I'm working on a Table that works great except data that has the ampersand (&) returns unexpected results.

Example B&A Scholarship Fund returns
B Scholarship Fund

The "&" is getting stripped including anything until the next word.

I know I have to use the NormalizeEntities function but in this particular case don't know where or how to write the syntax.

Here's the table:

new FPTable;
var table = new FPTable;

for (i=1;i<=12;i++) {//Loop through fields
if (Field("Amount_"+i)!="") {//add a row if the Amount field is not empty
var tableRow = table.AddRow();
tableRow.Cells[0].HAlign = "Left";
tableRow.Cells[1].HAlign = "Center";
tableRow.SetContents(Field("Designation_"+i),Field ("GC"+i),Field("Amount_"+i)); //Add content to the columns
for (c=0;c<=2;c++) {//loop through cells to apply margins & font
tableRow.Cells[c].Margins = { Top:0, Bottom:68, Left:0, Right:0 };
tableRow.Cells[c].Font = "Crimson Roman";

var totalRow = table.AddRow(); //Add total row
totalRow.Cells[0].HAlign = "Left";
totalRow.Cells[2].HAlign = "Center";
totalRow.SetContents("TOTAL 2018 TAX-DEDUCTIBLE GIVING:","",Field("CAL18_TTL")+"*"); //Set total row content
for (c=0;c<=2;c++) {//loop through cells to apply margins & font
totalRow.Cells[c].Margins = { Top:0, Bottom:68, Left:0, Right:0 };
totalRow.Cells[c].Font = "Brandon Grotesque Bold";
return table.MakeTags();

Any help would be greatly appreciated!
Reply With Quote
Old February 12th, 2019, 12:17 PM
kjacobson's Avatar
kjacobson kjacobson is offline
Regular Contributor
Join Date: Oct 2008
Location: Alameda, CA
Posts: 54
Default Re: Table with ampersand in data

Hi again!
I answered this on your original thread. Let me know if that solution doesn't work for you.
Windows 7 | InDesign CC 2017 | Acrobat DC 2019 | FusionPro 11.0.8 | MarcomCentral User
Reply With Quote

ampersand, normalizeentities, table

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 05:38 AM.

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