bkurzbuch Posted May 6, 2020 Share Posted May 6, 2020 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(); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted May 6, 2020 Share Posted May 6, 2020 It's not clear what error you're getting, but you should be able to just add the percent sign in the call to row.SetContents at the end, like so: row.SetContents(item, desc, disc + '%', price); Quote Link to comment Share on other sites More sharing options...
bkurzbuch Posted May 6, 2020 Author Share Posted May 6, 2020 Thanks Dan I wasting to add it where the red text is in my previous post. My bad. As always thanks so much. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.