Jump to content

Multi-line Rule in Bulleted List form.


Recommended Posts

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

Link to comment
Share on other sites

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;

 

Link to comment
Share on other sites

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:
        image.png.a44c337abe623243bd7207f68dc4b2ec.png 

it ends up looking like this: 
       image.png.1add90206ca5cebee222989e08230ca6.png


rather than this, which is the goal:

       image.png.171c263fcfbf97f04122b0cc1b77709a.png

 

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

       image.png.81d1230097c176d9b1d6b3c6d18ef5f0.png

Link to comment
Share on other sites

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>&bull;<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

  • Thanks 1
Link to comment
Share on other sites

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>&bull;<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. :D :D thank you so much!

Link to comment
Share on other sites

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