Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Get a query in htlm form

Community Beginner ,
Dec 04, 2007 Dec 04, 2007
I am creating a document where the content is extracted from a query created from the content of a MSSQL database.

Each datarecord is the content of the document. The problem I am facing is that the data fields are returned as pure text records. When CF renders the document, the query returns text contents eliminates all the returns spaces and paragraph format.
When the content of the return record is a document section with several paragraphs, the resulting query returns all the text together but without the text return spaces and all the paragraph are run together.

You can see what I see in http://www.spccwriter.com
userid: test pasw:123 hit Get SPCC . The document pw is: test
You will notice that many of the section run the paragraph together suppresing the return to separate a paragraph from another (Like in section 112.2 Definitions).

Any hint how to do this correctly? I am not sure if the trick resides in the CF coding or in the cfquery Database formating parameters.






TOPICS
Database access
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2007 Dec 04, 2007
several things you can do:

1) try using paragraphformat() around the troublesome variables
2) use replace(yourstring, "#chr(10)##chr(13)#", "<br>", "ALL") on your
strings to replace line-feed and carriage-returns with <br>. you may
need to replace only one of them, not both

---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 04, 2007 Dec 04, 2007
Perhaps you might want to take a look at the HTMLCodeFormat() function.

Phil
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 04, 2007 Dec 04, 2007
This is an interesting option suggested.

I tried this out around the variable, but this tag does not wrk very well inside cfdocument tags. The server hangs for a longtime and dies
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 04, 2007 Dec 04, 2007
Replace the text characters for newline, tab, etc with the HTML equivalent.

See attached sample
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 12, 2007 Dec 12, 2007
LATEST
Coould you show me how this functiona tags are applied to the code. I am not sure how the syntax will be applied.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 04, 2007 Dec 04, 2007
As well as the other suggestions to modify your content from ASCII text
to HTML text so that it displays correctly in a browser you could use
the HTML tags designed to display ASCII text, <pre></pre> or
<code></code>.

Which of these serveral solutions works best depends on what your
requirements are.

An important concept to point out here is that NOTHING is happening to
the returns and spaces, they are just being ignored by the browser
according to the HTML specification on how white space works in HTML
documents. So the query is returning all the paragraphs and such, they
just don't mean anything to HTML.



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 05, 2007 Dec 05, 2007
I got it to deliver a document, but it places several empty pages between cut off liles. If does nto work as expected with variables resulting from a query
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 05, 2007 Dec 05, 2007
I am trying to use the example from Adobe DOC

<h3>ParagraphFormat Example</h3>
<p>Enter text into this textarea, and see it returned as HTML.
<cfif IsDefined("FORM.myTextArea")>
<p>Your text area, formatted
<p><cfoutput>#ParagraphFormat(FORM.myTextArea)#</cfoutput>
</cfif>
<!--- use #Chr(10)##Chr(13)# to simulate a line feed/carriage
return combination; i.e, a return --->
<form action = "paragraphformat.cfm">
<textArea name = "MyTextArea" cols = "35" ROWS = 8>
This is sample text and you see how it scrolls
<cfoutput>#Chr(10)##Chr(13)#</cfoutput>
From one line
<cfoutput>#Chr(10)##Chr(13)##Chr(10)##Chr(13)#</cfoutput>
to the next
</textArea>
<input type = "Submit" name = "Show me the HTML version">
</form>


Tis sample returns nothing. Has anyone tried this?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 05, 2007 Dec 05, 2007
add method="post" to the <form> tag

---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources