Jump to content

Recommended Posts

Posted

I need some help and keep in mind I am very new to programming. I am trying to create a table in fusionpro that consists of 3 columns and 2 rows. I would like to call it from a function and use it in a if statement.

 

The data should print like so.

College 1 College 2 College 3

Code 1 Code 2 Code 3.

 

Is there an easy way to create a table? I have written the code that I thought would produce results if you would like to look at my mess. Thanks in advance for your help.

Posted

There are a couple table examples in the Frodo Travel tutorial. Look at the Money Table rule. Or look at the many examples here on this forum.

 

For your specific requirements, I think you want to do something like this:

var table = new FPTable;

table.AddColumns(10000, 10000, 10000);

for (var r = 1; r <= 2; r++)
{
   var row = table.AddRow();

   for (var c = 1; c <= 3; c++)
   {
       var cell = row.Cells[c - 1];
       cell.Content = Field((r == 1 ? "College" : "Code") + " " + c);
       cell.SetBorders("Thin", "Black", "Top", "Bottom", "Left", "Right");
   }
}

return table.MakeTags();

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