MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Issues, Questions, Etc. (http://forums.pti.com/forumdisplay.php?f=40)
-   -   Possible Bug Text Color Not Changing (http://forums.pti.com/showthread.php?t=4971)

Landisa August 29th, 2017 01:05 PM

Text Color Not Changing
 
I really didn't want to post this but after hours of searching I couldn't find a reason.

I have two templates that use this code. One of the templates refuses to turn the text of the table white.

I have:
  • Made the made Variable in the Text Frame as White text
  • I have edited my Table rule so both outcomes show as White
  • I have edited the outcome for other variables other than "RED" and they work
  • I have rewritten the code so not RED would be Black
  • Tried seeing if it composed properly even if preview was bad (didn't work)

However, no matter what I have done the code still shows black text on a dark colored background. Here is my code:

Code:

var tbl = [];
var myTable = new FPTable;
myTable.AddColumns(3000, 3000, 3000, 3000, 3000);

if (Field("RUN COLOR") == "RED")
{
    //Formatting the table
    for (var i=0; i<2; i++)
    {
        var row = myTable.AddRow();
        var cell = row.Cells[0];
       
        cell.Margins = new FPTableMargins;
        cell.Margins = {Bottom: 0, Top: 0, Left: 0, Right: 0};

        //cell.SetBorders("Thin", "Black", "Top", "Right", "Bottom", "Left");
        cell.HAlign = "Right";
        cell.VAlign = "Bottom";
        cell.TextColor = "White";
        row.CopyCells(0,1,2,3,4);
        row.minHeight = 800;
    }
}
else
{
    //Formatting the table
    for (var i=0; i<2; i++)
    {
        var row = myTable.AddRow();
        var cell = row.Cells[0];
       
        cell.Margins = new FPTableMargins;
        cell.Margins = {Bottom: 0, Top: 0, Left: 0, Right: 0};

        //cell.SetBorders("Thin", "Black", "Top", "Right", "Bottom", "Left");
        cell.HAlign = "Right";
        cell.VAlign = "Bottom";
        cell.TextColor = "Black";
        row.CopyCells(0,1,2,3,4);
        row.minHeight = 800;
    }
}

//Insert Data into Rows
myTable.Rows[0].SetContents("<color name=\"White\">" + Field("BOX09"), Field("BOX07"), Field("BOX05"), Field("BOX03"), Field("BOX01")); //Row 1
myTable.Rows[1].SetContents(Field("BOX10"), Field("BOX08"), Field("BOX06"), Field("BOX04"), Field("BOX02")); //Row 2

BoxSet = myTable.MakeTags().replace(/^\<table/, "<table alignment=right");

return BoxSet;

If it is helpful to know this code slightly varies from the other template that does work. Here is that code:

Code:

var tbl = [];
var myTable = new FPTable;
myTable.AddColumns(3100, 3100, 3100, 3100);

if (Field("RUN COLOR") == "RED")
{
    //Formatting the table
    for (var i=0; i<3; i++)
    {
        var row = myTable.AddRow();
        var cell = row.Cells[0];
       
        cell.Margins = new FPTableMargins;
        cell.Margins = {Bottom: 0, Top: 0, Left: 0, Right: 0};

        //cell.SetBorders("Thin", "Black", "Top", "Right", "Bottom", "Left");
        cell.HAlign = "Right";
        cell.VAlign = "Bottom";
        cell.TextColor = "White";
        row.CopyCells(0,1,2,3);
        row.minHeight = 1200;
    }
}
else
{
    //Formatting the table
    for (var i=0; i<3; i++)
    {
        var row = myTable.AddRow();
        var cell = row.Cells[0];
       
        cell.Margins = new FPTableMargins;
        cell.Margins = {Bottom: 0, Top: 0, Left: 0, Right: 0};

        //cell.SetBorders("Thin", "Black", "Top", "Right", "Bottom", "Left");
        cell.HAlign = "Right";
        cell.VAlign = "Bottom";
        cell.TextColor = "Black";
        row.CopyCells(0,1,2,3);
        row.minHeight = 1200;
    }
}

//Insert Data into Rows
myTable.Rows[0].SetContents(Field("BOX10"), Field("BOX07"), Field("BOX04"), Field("BOX01")); //Row 1
myTable.Rows[1].SetContents(Field("BOX11"), Field("BOX08"), Field("BOX05"), Field("BOX02")); //Row 2
myTable.Rows[2].SetContents(Field("BOX12"), Field("BOX09"), Field("BOX06"), Field("BOX03")); //Row 3

BoxSet = myTable.MakeTags().replace(/^\<table/, "<table alignment=right");

return BoxSet;

If someone could just guide me to what is causing this issue of being black all the time regardless of the Rules or what is set in the Text Frame, I would appreciate it.

It may be possible I am just missing something small but it absolutely does not change to White if the background frame is Red.

Dan Korn August 29th, 2017 02:08 PM

Re: Text Color Not Changing
 
The first question I always ask in situations like this is, are there any messages about colors in the composition log (.msg) file?

The next thing is, try looking at the actual tags generated. I would add this line right before the ending "return BoxSet" line:
Code:

Print(BoxSet);
Then look in the .msg file to see whether the tags look right.

Landisa August 30th, 2017 07:06 AM

Re: Text Color Not Changing
 
Quote:

Originally Posted by Dan Korn (Post 20438)
The first question I always ask in situations like this is, are there any messages about colors in the composition log (.msg) file?

I am not sure I understand the message in the box but I see this for all of the records and the only one not composing correctly are on Sheet #6
Code:

Composing record #54, input record 54
    Sheet #6, record #1
No value associated to graphic copyhole <SetGraphic_Temp_1> in record 54.

Quote:

Originally Posted by Dan Korn (Post 20438)
The next thing is, try looking at the actual tags generated. I would add this line right before the ending "return BoxSet" line:
Code:

Print(BoxSet);
Then look in the .msg file to see whether the tags look right.

This seems to help a bit more when compared to the other template that works the output code is identical. Here is the code snippet on the area that is still showing black:
Code:

Composing record #54, input record 54
    Sheet #6, record #1
No value associated to graphic copyhole <SetGraphic_Temp_1> in record 54.
<table alignment=right columns=5>

[SNIPPED]

<cell margins=Top:0;Bottom:0;Left:0;Right:0>
<p br=false quad="R"><p br=false cellalignment="Bottom">
<span><color name="White">125</span>

So yeah the tag definitely looks correct. This is the number that is showing up black when it needs to be white.

If you want I can always attach the .msg files if you think it will help.

Dan Korn August 30th, 2017 08:14 AM

Re: Text Color Not Changing
 
Quote:

Originally Posted by Landisa (Post 20440)
I am not sure I understand the message in the box but I see this for all of the records and the only one not composing correctly are on Sheet #6
Code:

Composing record #54, input record 54
    Sheet #6, record #1
No value associated to graphic copyhole <SetGraphic_Temp_1> in record 54.


Well, that's not a message about colors. You probably have a call to FindGraphicFrame that's not actually setting a graphic in the frame. Anyway, that message is benign.
Quote:

Originally Posted by Landisa (Post 20440)
This seems to help a bit more when compared to the other template that works the output code is identical. Here is the code snippet on the area that is still showing black:
Code:

Composing record #54, input record 54
    Sheet #6, record #1
No value associated to graphic copyhole <SetGraphic_Temp_1> in record 54.
<table alignment=right columns=5>

[SNIPPED]

<cell margins=Top:0;Bottom:0;Left:0;Right:0>
<p br=false quad="R"><p br=false cellalignment="Bottom">
<span><color name="White">125</span>

So yeah the tag definitely looks correct. This is the number that is showing up black when it needs to be white.

That does seem like the correct tag. Are you sure that corresponds to the output? Could there be another table cell with the same number?

Perhaps you have tag such as <span color=Black> outside of the table, which is keeping the color fixed. I would try moving the table to another frame.

I would also try reducing the problem to a minimal example; for instance, does a simple table with a single cell have the same problem? If not, try adding the rest back in until you find what triggers it.
Quote:

Originally Posted by Landisa (Post 20440)
If you want I can always attach the .msg files if you think it will help.

Well, the log file is great, but I'm still looking at this through a keyhole. If you want to attach the collected job, I might be able to look at it.

Landisa August 30th, 2017 10:06 AM

Re: Text Color Not Changing
 
1 Attachment(s)
Quote:

Originally Posted by Dan Korn (Post 20441)
That does seem like the correct tag. Are you sure that corresponds to the output? Could there be another table cell with the same number?

Perhaps you have tag such as <span color=Black> outside of the table, which is keeping the color fixed. I would try moving the table to another frame.

I would also try reducing the problem to a minimal example; for instance, does a simple table with a single cell have the same problem? If not, try adding the rest back in until you find what triggers it.

Well, the log file is great, but I'm still looking at this through a keyhole. If you want to attach the collected job, I might be able to look at it.

Dan, I wasn't sure what part would help you the best so I have attached the complete composition folder. I did find and correct the graphic frame issue.

I will try removing rows and cells to reduce the number of possibilities.
I have tried deleting and rebuilding the Text Frame without success.

Leosmith August 30th, 2017 10:56 AM

Re: Text Color Not Changing
 
added </span> to FORMAT_agency rule and it seems to give the results your looking for.
Leo

Quote:

if (Field("RUN COLOR") == "RED")
{
return "<span color=\"White\">" + Field("AGENCY") + '</span>';
}
else
{
return Field("AGENCY");
}

Landisa August 30th, 2017 11:00 AM

Re: Text Color Not Changing
 
Quote:

Originally Posted by Leosmith (Post 20443)
added </span> to FORMAT_agency rule and it seems to give the results your looking for.
Leo

*facepalm*
I didn't even think to check to see that the other code was working properly.

Thanks! ^^,


All times are GMT -7. The time now is 05:06 AM.

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