Question

Paragraph and blank space when no value present

Hello All

I have a paragraph rule where following properties are referenced in the below fashion

<<.AddressLine1>>

<<.AddressLine2>>

<<.AddressLine3>>

<<.City>>, <<.State>>, <<.Zip>>

The value for .AdressLine3 and AddressLine2 could be blank some times. When that propertty is null, system is introducing a blank line(s) between AddressLine1 and City,State,Zip.

Anything we can do to make the system not do that.

Appreciate all the help

***Edited by Moderator Marissa to update platform capability tags****

Correct Answer
September 13, 2019 - 1:54pm

Hey AbhinayC,

I tried and I am able to make it. Please follow below steps.

So you have paragraph rule like I show below.

When you display it shows like as shown below (IN PDF also same)

To remove the space for the properties which does not have values, 

1) Use a condition when rule to display the property. i.e

    Click on the magnifier icon of the property in paragraph rule, (on move hover you see that)

Once you click on the magnifier, you would see the following modal dialog, In the modal dialog, configure a when rule, I configured "PropEmpty"

PropEmpty when rule configuration is,

Repeat the step for all the properties those would go empty at runtime and you dont want to see the space reserve for them in the PDF or UI

2) Now, Go to paragraph rule, Click source. you see as shown below

Remove the following red highlighted content from the source

Now, Please move the <br/> tags to inside of when rule for the only properties configured with When rule, as shown below, this is the final code

Trunoff source mode (Click again on "Source" button), look like below

Save all the rules modified and run the scenario,

If I've the value in Addressline2 then it will look like

Thats it !! As you are generating the PDF out of the section, whatever you see in the section, same is posted to PDF. So, The same solution works for both PDF and UI 

In case, you dont see the expected out come, Please revisit

a) Your paragraph source editing

b) When rules of the properties are properly configured and true when values are empty.

Please feel free to reply for any questions.

Thank you,

Regards, Cherb.

Comments

Keep up to date on this post and subscribe to comments

September 13, 2019 - 12:24am

Please paste the below code in userworkform and let me know the outcome.

<style>

br + br { display:none; } 

</style>

September 13, 2019 - 11:43am
Response to Rachit_Agarwal

Didn't work :(

Just FYI, this paragraph rule is in section which in turn is referenced in html for HTMLtoPDF activity

 

 

September 13, 2019 - 4:42am

Hi @AbhinayC,

Please try adding the below code in the Userworkform and let us know the result of the same.

<script>
  $('br').each(function () {
if ($(this).next().is('br')) {
$(this).next().remove();
}
});
</script>

Hope this helps.

Regards,

Nandhadeepa 

September 13, 2019 - 11:43am
Response to Nandhadeepa_V

Didn't work :(

Just FYI, this paragraph rule is in section which in turn is referenced in html for HTMLtoPDF activity

 

 

Pega
September 13, 2019 - 12:17pm

Hi AbhinayC

Not sure what version of Pega you are on.

Take a look at these posts and see if they are helpful for your version

https://community.pega.com/support/support-articles/htmltopdf-converts-pdf-extra-line-spaces

https://community.pega.com/support/support-articles/paragraph-issue

Thanks

Pega
September 13, 2019 - 1:54pm

Hey AbhinayC,

I tried and I am able to make it. Please follow below steps.

So you have paragraph rule like I show below.

When you display it shows like as shown below (IN PDF also same)

To remove the space for the properties which does not have values, 

1) Use a condition when rule to display the property. i.e

    Click on the magnifier icon of the property in paragraph rule, (on move hover you see that)

Once you click on the magnifier, you would see the following modal dialog, In the modal dialog, configure a when rule, I configured "PropEmpty"

PropEmpty when rule configuration is,

Repeat the step for all the properties those would go empty at runtime and you dont want to see the space reserve for them in the PDF or UI

2) Now, Go to paragraph rule, Click source. you see as shown below

Remove the following red highlighted content from the source

Now, Please move the <br/> tags to inside of when rule for the only properties configured with When rule, as shown below, this is the final code

Trunoff source mode (Click again on "Source" button), look like below

Save all the rules modified and run the scenario,

If I've the value in Addressline2 then it will look like

Thats it !! As you are generating the PDF out of the section, whatever you see in the section, same is posted to PDF. So, The same solution works for both PDF and UI 

In case, you dont see the expected out come, Please revisit

a) Your paragraph source editing

b) When rules of the properties are properly configured and true when values are empty.

Please feel free to reply for any questions.

Thank you,

Regards, Cherb.

September 13, 2019 - 2:08pm
Response to cherb

Thank you. This worked

Pega
September 13, 2019 - 5:04pm
Response to AbhinayC

Glad ! You're very welcome !!