Jump to content

Weird spacing in some cells


n2_space

Recommended Posts

Ok, I'm stuck :( We are updating a clients files to new artwork, and basically creating the same table as currently made. However, I am confused as to the last (visible) columns spacing. I can't post everything since there is NDA involved, but if you see the attached screen shot, the far right column cells sometimes space properly (first and last), while the middle two have some weird spacing going on. Even changing it to a ridiculous font size like 2 makes the gaps that are evident in the screen shot even more so.

 

Here is the rule creating the table:

 

if (FusionPro.inValidation)

Rule("OnJobStart");

var myTable = new FPTable;

var MA = "";

var PLAN = "";

var PA = "";

var PAC1 = "";

var PAC2 = "";

var PAC3 = "";

var PAC4 = "";

var counter = 0;

var Plantype = "";

//myTable.AddColumns(27850, 5800, 28000, 2000);

myTable.AddColumns(27850, 5800, 28000, 2000);

myTable.AddRows(1);

//myTable.Rows[0].CopyCells(0, 1,2);

for (item=01;item<5;item++)

{

 

itemName="CommercialPlan" + item;

for (i = 1; i < XDF.recordCount+1; i++)

{

Plantype = XDF.GetFieldValue(i, 2);

MSA = XDF.GetFieldValue(i, 1);

PLAN = XDF.GetFieldValue(i, 5);

if ((Field("MSA") == MSA && MSA != "") && (Field(itemName) == PLAN && PLAN != "" && PLAN != "None") && (Plantype == "Commercial"))

{

counter++;

 

PA = XDF.GetFieldValue(i, 9);

PAC1 = XDF.GetFieldValue(i, 10);

PAC2 = XDF.GetFieldValue(i, 11);

PAC3 = XDF.GetFieldValue(i, 12);

PAC4 = XDF.GetFieldValue(i, 13);

if (PAC1 != "")

PAC1 = " • "+PAC1;

if (PAC2 != "")

PAC2 = " • "+PAC2;

if (PAC3 != "")

PAC3 = " • "+PAC3;

if (PAC4 != "")

PAC4 = " • "+PAC4;

var s = "";

s = AppendText(s, " ", PAC1);

s = AppendText(s, "<br>", PAC2);

s = AppendText(s, "<br>", PAC3);

s = AppendText(s, "<br>", PAC4);

myTable.AddRows(1);

if (item%2 == 1)

{

myTable.Rows[counter].Cells[0].ShadeColor = "Table Purple";

myTable.Rows[counter].Cells[0].ShadePct = "100";

}

else if (item%2 == 0)

{

myTable.Rows[counter].Cells[0].ShadeColor = "Table Green";

myTable.Rows[counter].Cells[0].ShadePct = "100";

}

myTable.Rows[counter].Cells[0].SetBorders("Thin", "White", "Top", "Bottom", "Right", "Left");

myTable.Rows[counter].Cells[0].Font = "HelveticaNeue-Condensed";

myTable.Rows[counter].Cells[0].PointSize = "10";

myTable.Rows[counter].Cells[0].TextColor = "Text Blue";

myTable.Rows[counter].Cells[0].Margins = new FPTableMargins;

myTable.Rows[counter].Cells[0].Margins.Top = 10;

myTable.Rows[counter].Cells[0].Margins.Bottom = 30;

myTable.Rows[counter].CopyCells(0, 1,2);

myTable.Rows[counter].Cells[3].Margins = new FPTableMargins;

myTable.Rows[counter].Cells[3].Margins.Top = 10;

myTable.Rows[counter].Cells[3].Margins.Bottom = 30;

myTable.Rows[counter].Cells[2].PointSize = "8";

myTable.Rows[counter].Cells[3].PointSize = "7";

myTable.Rows[counter].SetContents("      " + Field(itemName) , PA, "<leading newsize=120>" + s, " <br> <br> <br> "); //these crazy spaces are to keep the spacing consistent

myTable.Rows[counter].Cells[0].HAlign = "Left";

myTable.Rows[counter].Cells[0].VAlign = "Middle";

myTable.Rows[counter].Cells[1].HAlign = "Center";

myTable.Rows[counter].Cells[1].VAlign = "Middle";

myTable.Rows[counter].Cells[2].HAlign = "Left";

myTable.Rows[counter].Cells[2].VAlign = "Middle";

myTable.Rows[counter].Cells[3].VAlign = "Middle";

myTable.Rows[0].Type = "Skip";

}

}

}

myTable.Rows[1].Cells[0].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[1].Cells[1].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[1].Cells[2].SetBorders("Thin", "Border Green", "Top", "Bottom");

 

myTable.Rows[2].Cells[0].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[2].Cells[1].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[2].Cells[2].SetBorders("Thin", "Border Green", "Top", "Bottom");

 

myTable.Rows[3].Cells[0].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[3].Cells[1].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[3].Cells[2].SetBorders("Thin", "Border Green", "Top", "Bottom");

 

myTable.Rows[4].Cells[0].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[4].Cells[1].SetBorders("Thin", "Border Green", "Top", "Bottom");

myTable.Rows[4].Cells[2].SetBorders("Thin", "Border Green", "Top", "Bottom");

 

 

if (counter > 0)

return myTable.MakeTags();

else return "";

 

 

The appendText global is as follows:

 

//create a function to append text

function AppendText(FullText, Delimiter, NewText)

{

if (NewText != "")

{

if (FullText != "")

FullText += Delimiter;

 

FullText += NewText;

}

 

return FullText;

}

 

I can't figure out the weird spacing on those cells.... I've spent all week messing with it and am just lost. Any ideas? :o

screenshot.thumb.jpg.3bc7306082794d891eaba72c81474c98.jpg

Link to comment
Share on other sites

The irony of your user name and the problem expressed in this post is overwhelming. :)

Do you have "use legacy line leading" checked in the global settings of the paragraph settings?

I guess it is ironic :D

 

It is checked, I think that might fix the problem, thanks! I never thought to look there, I just kept looking at the code looking for something in there :o

 

Now on to fixing the next issue :)

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.

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