Align data left and at the top

Hi,

I want to display a few lines of text in one cel of a table.
I expand (resize it) this cell and want to put data from a database field in it. The database field contains a few lines of text.

The reason I use one cell is I just want to display the data. The user can only see it and not modify it ofcourse.

Can someone help me with this?

I tried <td align="left"> but that didn't work.

I appriciate your help.
 

gcampbell

Member
I don't think you explain your problem very clearly ...

but another option you might try is adding the valign option to the TD element

example:

<TD align="left" valign="top">
 

jongpau

Member
And if you want to keep any line breaks/new lines in the text (if these are there) you should of course also add a html <br> for each new line. You could do that with something like this

`REPLACE(<field-name>,"~n":U,"<BR>":U)`

when you put the data in the table cell.
 

jongpau

Member
Oops, make that:

`REPLACE(HTML-ENCODE(<field-name>),"~n":U,"<BR>":U)`

Sorry, the brain is not 100% awake yet
 
jongpau said:
Oops, make that:

`REPLACE(HTML-ENCODE(<field-name>),"~n":U,"<BR>":U)`

Sorry, the brain is not 100% awake yet

Hi,


thanks for your reply.

Do u mean I have to put this line: `REPLACE(HTML-ENCODE(<field-name>),"~n":U,"<BR>":U)`
betweed the td tags?

many thanks
 
Speedy Gonzalez said:
Hi,


thanks for your reply.

Do u mean I have to put this line: `REPLACE(HTML-ENCODE(<field-name>),"~n":U,"<BR>":U)`
betweed the td tags?

many thanks

Hi JongPau,

I've tried you're solution and it worked!!!
Many thanks man, now I can move on.

I have another problem:

I have added some info in a textarea on a page. Now after pressing submit, I go to another page in which the info I typed in the previous page is being displayed in a table cell and now (thanks to your help) it displays the data accordingly with breaks in lines where it should.

Now the problem.

In that second page in which the textarea data is being displayed in a tablecel, there is another textarea in which it is possible to add some extra information. After pressing the submit button the extra information should be added in the table cell in which all the previous information was stored.

How to do this, de server log file comes with this error:

'Invalid character in numeric input y. (76)'

Any ideas??

Many thanks!
 
jongpau said:
Mate, sorry, but it will be hard to day anything useful without seeing your code....

Hi,

This is the code:

<table border="1" width="100%" id="table9" style="border-collapse: collapse">
<tr>
<td width="98">Subject:</td>
<td><input type="text" name="subj" size="56" value= "` substitute("&1", subj#) `"></td>
</tr>
<tr>
<td width="98" valign="top">Previous details:</td>
<td>
<table border="1" width="100%" id="table10" style="border-collapse: collapse">
<tr>
<td align="left"> `REPLACE(HTML-ENCODE(details#),"~n":U,"<BR>":U)` </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="98">Add details:</td>
<td><textarea rows="16" name="extrdeta" cols="60" wrap=physical></textarea></td>
</tr>

</table>

As you can see, there is one tablecel in which I put all the info. I choose to do this so because then the user can see all the previous info which has been logged but he can't remove it.

Underneath the table cel, there is a textarea in which it should be possible to add some info. After adding, the info which you typed in the text earea should be put under the previously logged info in the tablecell.

Now this is working a bit but I want it better.

I would like it if after I add some text, the date must be logged as well and after adding some text, the newly added text should jump down 2 spaces so it can be viewed accordingly.

This is an example of how the info in the table cell should look like:


06/09/05 15:15 Frank Meulblok
Dear,

some text....

regards,

Speedy


06/10/05 11:48 Rob Debbage
Dear Speedy,

a reply to speedy...

Regards,

Robby

Progress Technical Support EMEA


As you can see, the date is set above each info.

What is the appropiate syntax to achieve this?

Many thanks in advance!
 
Hi,

I have another question.

I would like to have the option to attach files per added info.
What is the syntax for this (using the code above)?

Thanks in advance!
 

Casper

ProgressTalk.com Moderator
Staff member
Do you want the user to be able to upload files to your webserver? Is that your question?
If so then use streamfile.p from FFW.

Casper.
 
Casper said:
Do you want the user to be able to upload files to your webserver? Is that your question?
If so then use streamfile.p from FFW.

Casper.

Yes.

So a user is adding info and he/she wants to add a file (most of the time a .jpeg or .gif file or a doc file) with that bit of info.
I'll have a look at streamfile.p

thanks!
 

jongpau

Member
As to your original question, if you want to drop down 2 lines and then insert a date and some more text, just add it to the string:

<field-name> = <field-name>
+ "<B>":U + (IF <field-name> EQ "":U THEN "":U ELSE "~n~n":U)
+ STRING(TODAY,"99/99/9999":U) + " ":U + STRING(TIME,"HH:MM:SS":U)
+ "</B>~n":U
+ GET-VALUE("extrdeta":U).

and then simply dispay the thing again in your table.

Better watch it that you do not exceed the maximum size of the character data-type on your current Progress version. If it is a public system there will always be people that try to crash your little system by overflowing it with data.....

Uploading files is something I have always managed to avoid in Progress (since Progress/WebSpeed itself only allows upload of character files and no binary data). So for that info you will have to follow the lead given to you by Caspar.
 
jongpau said:
As to your original question, if you want to drop down 2 lines and then insert a date and some more text, just add it to the string:

<field-name> = <field-name>
+ "<B>":U + (IF <field-name> EQ "":U THEN "":U ELSE "~n~n":U)
+ STRING(TODAY,"99/99/9999":U) + " ":U + STRING(TIME,"HH:MM:SS":U)
+ "</B>~n":U
+ GET-VALUE("extrdeta":U).

and then simply dispay the thing again in your table.

Better watch it that you do not exceed the maximum size of the character data-type on your current Progress version. If it is a public system there will always be people that try to crash your little system by overflowing it with data.....

Uploading files is something I have always managed to avoid in Progress (since Progress/WebSpeed itself only allows upload of character files and no binary data). So for that info you will have to follow the lead given to you by Caspar.

Hi,

This is my code:

<table border="1" width="100%" id="table10" style="border-collapse: collapse">
<tr>
<td align="left"> `REPLACE(HTML-ENCODE(edeta#),"~n":U,"<BR>":U) + "<B>":U + (if edeta# EQ "":U THEN "":U ELSE "~n~n:U) + STRING(NOW,"99/99/9999 HH:MM:SS.SSS+HH:MM":U) + "<b/>~n":U + get-value("extrdeta":U). ` </td>
</tr>
</table>

However this doesn't compile.
It says unable to understand after "<BR>) + B
Cannot understand expression with addition.

Please help?
 
I think I need to clarify a few things.

I have now removed the textarea edeta# in the first page.

Now I only want to add details in the second page.

So in the second page there will be a empty tablecell.
Underneath it there is a textarea. In via that textarea people can add some text. Ofcourse with the date and name above en drop down 2 lines to add text.

This is the code:

<td width="98" valign="top">Previous details:</td>
<td>
<table border="1" width="100%" id="table10" style="border-collapse: collapse">
<tr>
<td align="left"> REPLACE(HTML-ENCODE(edeta#),"~n":U,"<BR>":U) + "<B>":U + (if edeta# EQ "":U THEN "":U ELSE "~n~n:U) + STRING(NOW,"99/99/9999 HH:MM:SS.SSS+HH:MM":U) + "<b/>~n":U + get-value("extrdeta":U). </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="98">Add a description of the call:</td>
<td><textarea rows="16" name="extrdeta" cols="80%"wrap=physical></textarea></td>
</tr>


Any ideas?

thanks!
 
I tried to insert that piece of code in the string that asignes the values which are in eextrdeta. So what I wrote in the previous post was that I put the code with that Replace statement. I realised I was making a huge mistake and so I tried something else:


So in de procedure output-headers I write:

find table where table.rcode = rcode# exclusive-lock.
MESSAGE 3.

assign table.edeta = substitute("&1&2&3&4&5",edeta + "<B>":U + (IF edeta EQ "":U THEN "":U ELSE "~n~n":U)
+ STRING(NOW,"99/99/9999 HH:MM:SS.SSS+HH:MM":U) + "</B>~n":U
+ get-value("eextrdeta#":U)).



And the original code of the tablecell stays the same:

<td align="left"> `REPLACE(HTML-ENCODE(edeta#),"~n":U,"<BR>":U)` </td>

This does not give any compile errors.



How ever when I enter a text this is the result:

<B>19/08/2005 13:40:09,921+02:00</B>
<B>

19/08/2005 13:41:59,000+02:00</B>
<B>

19/08/2005 13:42:35,281+02:00</B>

As you can see, I tried to enter 3 messages. I was hoping the date would be put first followed by 1 line of space and then the message.
After this I tried to enter another one.

AS you can see it only displays the date. No messages.

How come??


edit:
some extra info:
The edeta field in the database is being filled with: ""
SO I do:

create table
assign table.edeta = ""

.
Perhaps this is the problem?
 
Top