Jump to content
  • 0

Extra line break and additional line when fetching HTML text with SELECT statements to calculated field


KG360
 Share

Question

When enabling HTML editing of T64000 field, users can create text with headings etc., and the result is ok when the field is displayed in various Data Pages. Either two <br /> tags or end-of-paragraph </p> tags create a single line spacing between paragraphs.

However, when retrieving the same HTML text, using a SELECT statement, an extra line break and additional [empty] line is added, so one single line spacing between two paragraphs becomes two lines, etc. This means that the text looks awkward in one of the presentation methods, and, above all - they look different.

Does anyone on the forum know why  or have experienced the same? A single line break ( <br /> )and the-end-of-paragraph HTML tags causes the same issue.

I appreciate any hints!

Regards/G

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
On 7/21/2022 at 12:18 AM, futurist said:

Hi @Gunnar360c,

You can use the following SELECT statement to get rid of the extra line breaks:

Select Replace(Replace(Field,CHAR(10),''),CHAR(13),'') FROM Table

Many thanks @futurist, it works fine! I am curious about the syntax: why two 'Replace' and what does the (10) and (13) mean? Also - where does one find such solutions?  lso, I wonder why Caspio inserts the extra line break...

I always get terrific answers on this forum, thank you!

Regards/Gunnar

Link to comment
Share on other sites

  • 0

I have now educated myself on char(10) and char(13) and understand the single quotes without anything between (replace with nothing?).

I wrote SELECT Replace(Replace(Description,Char(10),''),CHar(13),'')FROM tbl-xyz.... 

Link to comment
Share on other sites

  • 0
5 hours ago, Gunnar360c said:

Many thanks @futurist, it works fine! I am curious about the syntax: why two 'Replace' and what does the (10) and (13) mean? Also - where does one find such solutions?  lso, I wonder why Caspio inserts the extra line break...

I always get terrific answers on this forum, thank you!

Regards/Gunnar

I'm not sure too why Caspio is inserting that extra line break (\n\r i suppose) and what the Replace(Replace(Field,CHAR(10),''),CHAR(13),'') is doing is replacing those \n\r that appear in the value with a blank value. So instead of having that line break, it turns them into '' which is essentially null

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
Answer this question...

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

Loading...
 Share

×
×
  • Create New...