Text with line break on field/cell

Discuss the database features
Post Reply
Ehesh
Posts: 19
Joined: Wed Apr 09, 2014 3:45 am

Text with line break on field/cell

Post by Ehesh »

Is it possible to have a database that keeps the format of line break on its body?

I am trying to create a form that stores the information from customer email messages and another mentioning the representative response. there is no text formatting in the body other than line break.

It seems that after entering the text all the linebreaks disappear and it gets scrunched up.
OpenOffice 4.0.1 Windows 8
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Text with line break on field/cell

Post by UnklDonald418 »

If the messages are short (255 or less) it's OK to use the VARCHAR data type, otherwise use MEMO data type for the table field.
On the Form open the Properties: Text Box dialog for the control and on the General tab set Text type property to Multi-line or Multi-line with formatting.
 Edit: Avoid Multi-line with formatting , apparently it doesn't store the the entered text in the database field 
Last edited by UnklDonald418 on Sat Jul 21, 2018 8:13 pm, edited 1 time in total.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Ehesh
Posts: 19
Joined: Wed Apr 09, 2014 3:45 am

Re: Text with line break on field/cell

Post by Ehesh »

UnklDonald418 wrote:If the messages are short (255 or less)
Why does the message size matter?
OpenOffice 4.0.1 Windows 8
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Text with line break on field/cell

Post by UnklDonald418 »

Why does the message size matter?
It is a memory efficiency thing. When the database is loaded into memory it reserves the number of characters specified in the VARCHAR field whether they are used or not. Memo fields don't have a specific size.
For a small database it doesn't matter all that much, but If you have thousands of records there is the possibility of seeing performance issues.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Ehesh
Posts: 19
Joined: Wed Apr 09, 2014 3:45 am

Re: Text with line break on field/cell

Post by Ehesh »

UnklDonald418 wrote:
Why does the message size matter?
It is a memory efficiency thing. When the database is loaded into memory it reserves the number of characters specified in the VARCHAR field whether they are used or not. Memo fields don't have a specific size.
For a small database it doesn't matter all that much, but If you have thousands of records there is the possibility of seeing performance issues.
Well, I don't think it is very large, I would just need to export the information to a spreadsheet at the end of every day and keeping. not really needing to revisit these records. More than a database, it's more actually for a form kind of submission. I do need the linebreak since I must fill between 50 to 80 entries every day. But after exporting them the database could be cleared or deleted.
OpenOffice 4.0.1 Windows 8
Ehesh
Posts: 19
Joined: Wed Apr 09, 2014 3:45 am

Re: Text with line break on field/cell

Post by Ehesh »

UnklDonald418 wrote:If the messages are short (255 or less) it's OK to use the VARCHAR data type, otherwise use MEMO data type for the table field.
On the Form open the Properties: Text Box dialog for the control and on the General tab set Text type property to Multi-line or Multi-line with formatting.
 Edit: Avoid Multi-line with formatting , apparently it doesn't store the the entered text in the database field 
Wait... so it doesn't work?
OpenOffice 4.0.1 Windows 8
UnklDonald418
Volunteer
Posts: 1548
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Text with line break on field/cell

Post by UnklDonald418 »

As supplied, Base is a front end for the HSQLDB database engine, version 1.8. Other than line breaks, the Embedded version of Base does not store formatting controls in table fields.
Add a TextBox control to your form and on the Data tab of the Properties:Text Box dialog select a Data field. Now on the General tab select Multi-line with with formatting for the Data type and notice that the Data tab has disappeared, which means the control is no longer connected to a database table. Now select Multi-line and the Data tab reappears as does the connection to the database table.
You can choose some formatting options on the General tab of the Properties:Text Box dialog but they apply to all the characters in all the records displayed by that control.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply