Jen Posted April 24 Posted April 24 Hello, Was hoping I could get some help, please? I currently have data that is Multi-line. I need to read 2 columns and put each new row on the letter with a bullet in front. However the 2nd column fills content from the bottom up. So I been using the rules attached, and create a resource with bullets followed by the rule, and hiding those which are blank. Is there a better way to go about this because I just learned that I can have a max of 80 rows in column 1, and a max of 20 in column 2, and since column 2 fills the content in excel from bottom to top, I have to create 100 different rules for column 2 and along with another 80 separate rules for column 1. 180 rules in my template sounds like way too many and was hoping there is an easier way? Resource looks like this: • «MultiLine - Bullet List (Column 1)Row1» • «MultiLine - Bullet List (Column 1)Row2» • «MultiLine - Bullet List (Column 1)Row3» MultiLine - Bullet List(Column 1)Row1.txt MultiLine - Bullet List(Column 2)Row1.txt Quote
ThomasLewis Posted April 24 Posted April 24 You already have the framework setup for a loop, but it looks like its never getting more than 1 value. It's hard to tell without seeing a sample of your input file, but maybe this would work out better for you. You would only need the 2 rules for this, one for each column. var data = FusionPro.GetMultiLineRecords(); var result = ""; for (var r = 1; r <= data.recordCount; r++) { var comment = data.GetFieldValue(r, "CPR Comment"); if (comment) result += comment + "<br>"; } return result; Quote
Jen Posted April 26 Author Posted April 26 On 4/24/2024 at 1:50 PM, ThomasLewis said: You already have the framework setup for a loop, but it looks like its never getting more than 1 value. It's hard to tell without seeing a sample of your input file, but maybe this would work out better for you. You would only need the 2 rules for this, one for each column. var data = FusionPro.GetMultiLineRecords(); var result = ""; for (var r = 1; r <= data.recordCount; r++) { var comment = data.GetFieldValue(r, "CPR Comment"); if (comment) result += comment + "<br>"; } return result; Almost but not quite. I did try something similar to this in the beginning, however they want each new row to start with a bullet. So I put: result += "• " + comment + "<br>"; HOWEVER, they also want the overflowing sentence to indent, but when I do the paragraph formatting like so: it ends up looking like this: rather than this, which is the goal: Then, I also have the issue with the Referral Comment, which looks similar to the images above in the letter, except this content fills into the excel file from bottom to top. And since the CPR comments may be 5 rows for 1 letter then the Referral comments don't start till row 6 in the data. This fluctuates for record, so therefor with my current set up I have a ton of CPR comments in a resource and Suppress each comment if its an empty variable. This has been working fine however, with now learning that I need to create a max of 100 Referral Comments and 80 CPR Comments, I feel like that's just to many rules Quote
ThomasLewis Posted April 26 Posted April 26 You can setup the paragraph formatting inline. Something like this: var data = FusionPro.GetMultiLineRecords(); var result = '<p br=false lindent=2400 findent="1400" tabstops="0;2400">'; for (var r = 1; r <= data.recordCount; r++) { var comment = data.GetFieldValue(r, "Referral Comment"); if (comment) result += '<p>•<t>' + comment; } return result; As far as the other items you mention go. Again, it would be helpful to have a sample data file. I don't really see why the above code wouldn't work though. Attached is a working example. multilinesample.zip 1 Quote
Jen Posted April 26 Author Posted April 26 2 hours ago, ThomasLewis said: You can setup the paragraph formatting inline. Something like this: var data = FusionPro.GetMultiLineRecords(); var result = '<p br=false lindent=2400 findent="1400" tabstops="0;2400">'; for (var r = 1; r <= data.recordCount; r++) { var comment = data.GetFieldValue(r, "Referral Comment"); if (comment) result += '<p>•<t>' + comment; } return result; As far as the other items you mention go. Again, it would be helpful to have a sample data file. I don't really see why the above code wouldn't work though. Attached is a working example. multilinesample.zip 7.48 kB · 0 downloads OMG this works! I just tested it and its working exactly how I need it to. thank you so much! Quote
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.