Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text interpretation: HTML

Status
Not open for further replies.

waldopepper

Programmer
Nov 21, 2003
124
GB
I've written a report that displays a text field (that contains HTML) - on the left in it's raw format and again on the right of the report rendered as HTML (Text interpretation) so I can see them both side-by-side.
It seemed to work OK but I've just noticed that it mainly just strips out tags such as <p> and <br> without actually inserting a new line/paragraph etc.

Is there any way I can get Crystal to insert a proper line break in the interpreted text when it finds a <p> or <br>?

Crystal Reports v10.
 
I just tried this with my copy of Crystal 10, using the paragraph tab and it worked as it is supposed to. Both P and BR breaks caused a line break.

I tried it with a formula under the formula button in the paragraph tab to see if it would work that way, it worked that way as well.

I'm not sure what to suggest, since I'm not reproducing it. Are you using a vb interface or something?

Scott.
 
Thanks - interesting. How did you create the test data? I've tried creating a new text object, but I can't change this to HTML under the paragraph tab.
I've just tried creating a new data source using Excel - this actually kindof works :<br>'s create a new line but <p> only creates a new line (no space in between).

The actual data I'm trying to work with is from a SQL stored procedure - when I hover over the text field in Crystal it says the type is 'Memo'. Could this be part of the problem?
 
I opened up a blank report, cancel out of connecting it to any data source.

Then I wrote a formula that consists of something like "Now is the winter of our discontent made glorious summer by this son of Windsor." with nothing else in it, of course. Just the text between the quotes.

Then I dumped the formula to the canvas and hit preview. Then I went back and inserted a paragraph break, <p> and later a <br>. I just put it in somewhere.

Then I went back to the canvas with the formula showing my shakespeare and went through the paragraph formatting. Made it do all the tricks listed, including the formula :

if instr({@test}, "w")>0 then crHTMLText else crUninterpretedText
with the w chosen at random to test.

The formula being only one of the tests.

Okay, so if you do all that and you get the result I did, I'm guessing that implies that a memo field is the culprit. If you get your original result then more digging is required.

I think, if you have MS-Access around you can create a table with a memo field in there that might act the same (although you never know with MS-Access).


Scott.
 
Thanks.
A I'm almost there - the field the data is held in is SQL nText format - I have casted it to varchar and now in Crystal it's no longer 'Memo' - it's a 'String' now.
The html is working now, but there is one weird thing, if there are two line feeds together '<br><br>' - only 1 line break appears in the interpreted text.
The whole point of viewing this html properly was to check the layout of html on a page but it looks as though it doesn't allow blank lines to be shown!

Does this happen for anyone else too?
I'm sure this is the same issue as <p> being treated as a <br> - a <p> should insert a blank line and a linefeed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top