Jump to content

Add "%" after table field


bkurzbuch

Recommended Posts

I need to add a "%" after the Disc field in a table. I tried a couple of options but I'm missing something as I always get a error on validation.

Thanks for your help

 

var myTable = new FPTable;
myTable.AddColumns(5760, 21168, 4536, 4536);  

for (var i = 1; i <= 20; i++)
{
   var item = Field("Item " + i);
   var desc = Field("Desc " + i);
   var disc = Field("Disc " + i);     [color="Red"]Insert % after this field [/color]
   var price = Field("Price " + i);

   // There 2 different triggers to not include a row.
   // 1. data is blank for that row.
   if (!item && !desc && !disc && !price)
       continue;

   // 2. The "Disc" field is zero.
   if (Int(disc) == 0)
       continue;

   // 3. The "Disc" field is zero.
   if (Int(disc) == 5)
       continue;

   var row = myTable.AddRow();

   var cell = row.Cells[0];
   cell.SetBorders("Thin", "Black", "Bottom");
   cell.Margins = new FPTableMargins;
   cell.Margins.Top = 25;
   cell.Margins.Bottom = 25;
   row.CopyCells(0, 1,2,3);

   cell.Margins = new FPTableMargins;
   cell.Margins.Top = 25;
   cell.Margins.Bottom = 25;
   cell.Margins.Left = 350;
   row.CopyCells(0, 1);

   row.Cells[0].HAlign = "Left";
   row.Cells[1].HAlign = "Left";
   row.Cells[2].HAlign = "Center";
   row.Cells[3].HAlign = "Center";

   row.Cells[0].Font = "News Gothic Bold";
   row.Cells[0].PointSize = 6;
   row.Cells[1].Font = "News Gothic Regular";
   row.Cells[1].PointSize = 7;
   row.Cells[2].Font = "News Gothic Bold";
   row.Cells[2].PointSize = 7;
   row.Cells[3].Font = "News Gothic Regular";
   row.Cells[3].PointSize = 7;

   row.SetContents(item, desc, disc, price);
}

return myTable.MakeTags();

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