Page 1 of 1

Return characters not printing

Posted: Sun Aug 09, 2009 1:49 pm
by bonbon
I'm trying to set up a simple report from a database, using the Ebook "Printing in Revolution" as a starting point. It's going OK, except that when I move data into the "holding" field, carriage return characters (Asc 10) are going missing.

This is the sort of thing I'm doing, within a loop:

Code: Select all

      set the htmlText of line LineToAdd of field "HoldContents" of card 1 of stack "PrintStack" to revDatabaseColumnNamed(curID, "EX_Description")
      put LineToAdd + 1 into LineToAdd
The result: field "HoldContents" ends up with all of the exercise text, word-wrapping nicely, but with no white space where the CRs used to be - very hard to read !

Any ideas ? Thanks.

(PS: I've checked that there really are no CRs by doing a "replace cr with LF in field ..." - no little boxes showed up, which is what LFs look like on Windows. I also checked that there really are CRs in the database, using a hex editor.)

Posted: Sun Aug 09, 2009 1:58 pm
by Klaus
Hi bonbon (what a sweet name :))

This is HTML!

HTML does not know the CR or RETURN!
In HTML new lines are created with TAGS like:
<p>THis is the first line</p><p> this is the second line AND <BR> this is the third line in the same P TAG! Amazing isn't it?</p>

Know what I mean? Valid HTML can be just ONE loooooong line.

So you need to modify the retrieved (hmtl source) text from the database.


Best

Klaus

Posted: Sun Aug 09, 2009 2:28 pm
by bonbon
Thanks Klaus - I'll have a go at that.