INGuser Posted December 18, 2013 Share Posted December 18, 2013 Good Morning, I am looking to get some help building a table that i am needing for a current project. I need to have the table laid out so that all the even numbered fields are on the right hand side and the odd numbered fields are on the left hand side. I am hoping to have it look something like below. I can create the header row but do not know how to create the body of the table so that all the body fields line up correctly. Fund Name Fund Percentage [fundbefore] [fundbefor2] [fundbefor3] [fundbefor4] [fundbefor5] [fundbefor6] [fundbefor7] [fundbefor8] [fundbefor9] [fundbefo10] [fundbefo11] [fundbefo12] [fundbefo13] [fundbefo14] [fundbefo15] [fundbefo16] [fundbefo17] [fundbefo18] [fundbefo19] [fundbefo20] [fundbefo21] [fundbefo22] [fundbefo23] [fundbefo24] [fundbefo25] [fundbefo26] [fundbefo27] [fundbefo28] [fundbefo29] [fundbefo30] [fundbefo31] [fundbefo32] [fundbefo33] [fundbefo34] [fundbefo35] [fundbefo36] [fundbefo37] [fundbefo38] [fundbefo39] [fundbefo40] [fundbefo41] [fundbefo42] [fundbefo43] [fundbefo44] Thank you in advance for any help offered. Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 18, 2013 Share Posted December 18, 2013 This should get you started: var table = new FPTable; table.AddColumns(10000, 10000); var row = table.AddRow(); row.Type = "Header"; row.Cells[0].Content = "Fund Name"; row.Cells[1].Content = "Fund Percentage"; function fundFieldName(i) { var result = "fundbefore"; if (i > 1) { var numStr = String(i); result = result.slice(0, 0-numStr.length) + numStr; } return result; } for (var i = 1; i <= 44; i+=2) { var row = table.AddRow(); row.Cells[0].Content = fundFieldName(i); row.Cells[1].Content = fundFieldName(i+1); } return table.MakeTags(); Quote Link to comment Share on other sites More sharing options...
GreggRusson Posted December 11, 2014 Share Posted December 11, 2014 Been a couple of years since working with FP and I'm having trouble setting up a simple FPTable. Placed this code in a rule and tried to validate it. I get the following error 'Table Rule line 8: TypeError: table.Rows[0] has no properties'. Any idea what I'm doing wrong here? TIA var table = new FPTable; table.AddColumns(10000,10000,10000); table.AddRows(1); table.Rows[0].Cells[0].Content = "Cell 0"; table.Rows[0].Cells[1].Content = "Cell 1"; table.Rows[0].Cells[2].Content = "Cell 2"; return table.MakeTags(); Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 11, 2014 Share Posted December 11, 2014 Been a couple of years since working with FP and I'm having trouble setting up a simple FPTable. Placed this code in a rule and tried to validate it. I get the following error 'Table Rule line 8: TypeError: table.Rows[0] has no properties'. Any idea what I'm doing wrong here? TIA var table = new FPTable; table.AddColumns(10000,10000,10000); table.AddRows(1); table.Rows[0].Cells[0].Content = "Cell 0"; table.Rows[0].Cells[1].Content = "Cell 1"; table.Rows[0].Cells[2].Content = "Cell 2"; return table.MakeTags(); What version of FusionPro? Quote Link to comment Share on other sites More sharing options...
GreggRusson Posted December 11, 2014 Share Posted December 11, 2014 Version 7.2 Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted December 11, 2014 Share Posted December 11, 2014 Does the "Money Table" rule in the Frodo Travel tutorial work? Quote Link to comment Share on other sites More sharing options...
GreggRusson Posted December 12, 2014 Share Posted December 12, 2014 Yes it does. Started off rebuilding my rule to match the examples from the Frodo tutorial. I found a logic error in one loop that took my table index out of bounds which would explain why there where no properties. Everything validated and I finished off my coding... but now it was complaining (on validation) that my edf object had no properties. Saved it anyways and everything previewed just fine. Composed the entire thing on the server with no problems. Weird... 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.