Hawk Posted March 16, 2016 Share Posted March 16, 2016 I'm trying to create a table form an external data file. There could be 1 or more matches in the external file from my main data file. I can't get the first matching row to display in my pdf. if there is only one row I get nothing. Here is my rule; if(FusionPro.Composition.isPreview == true || FusionPro.inValidation == true) { Rule("OnJobStart"); } var numRecsExtDF = XDF.recordCount; var myTable = '<table columns=16><column width=17400><column width=8500><column width=7200><column width=4400><column width=2875><column width=2875>' myTable += '<column width=2875><column width=2875><column width=2875><column width=2875><column width=2875><column width=2875><column width=2875>' myTable += '<column width=2875><column width=2875><column width=2875>'; for (recordWalker = 1; recordWalker <= numRecsExtDF; recordWalker++) { if (XDF.GetFieldValue(recordWalker, 3) == Field("EE.SSN")) { var ssNo = Right(XDF.GetFieldValue(recordWalker, 8),4) myTable += '<row minheight=3650><cell margins="top:030;bottom:030"><p br=false quad=C>' + XDF.GetFieldValue(recordWalker, 4) + ' ' + XDF.GetFieldValue(recordWalker, 6) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ "***-**-" + ssNo myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 9) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 10) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 11) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 12) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 13) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 14) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 15) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 16) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 17) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 18) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 19) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 20) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 21) myTable += '<cell margins="top:030;bottom:030"><p br=false quad=C>'+ XDF.GetFieldValue(recordWalker, 22) } } myTable += '</table>'; return myTable; Quote Link to comment Share on other sites More sharing options...
Dan Korn Posted March 16, 2016 Share Posted March 16, 2016 If the first row in the XDF is data (not field names), then you need to start iterating at record zero, not record one. 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.