473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Recordset value starting with "<" (less than sign) wont display

I am displaying some values on a report. I am opening the .asp page
with a
Response.ContentType = "application/msword" and these particular
values appear in a table. One column shows percentages such as "5",
"95", "50", or "<5" There is no "%" character stored in the database
just the number (and the "<" sign if there is one).

Problem is NONE of the "<5" values appear in my report table. Does
this have something to do with "<" being an html character. The field
type is just a size 3 nvarchar. Relevant code below:

strSQL2 = "SELECT * FROM jambue.SUMMARY WHERE POSCODE = '" & id & "'
AND IDCODE1 ='" & dept & "' AND IDCODE2 ='" & unit & "'"
Set rstDBEdit2 = Server.CreateObject("ADODB.Recordset")
rstDBEdit2.Open strSQL2, CONN_STRING, adOpenKeyset, adLockOptimistic,
adCmdText

<font face="Courier New" size="-1"><%=
rstDBEdit2.Fields("H_STAP").Value %> %</font>
Jul 19 '05 #1
2 1868
Use Server.HTMLEncode() if you want to display all symbols on the screen,
rather than use the exact text in your HTML. Otherwise, symbols like < will
get mixed with the other HTML content on your page and ahcnage the display.

E.g.

<%= Server.HTMLEncode(rstDBEdit2.Fields("H_STAP").Valu e) %>

The HTMLEncode method replaces certain symbols with the HTML equivalents. <
will be represented by &lt;

--
Manohar Kamath
Editor, .netWire
www.dotnetwire.com
"J.D. Buehls" <bu**************@yahoo.com> wrote in message
news:73**************************@posting.google.c om...
I am displaying some values on a report. I am opening the .asp page
with a
Response.ContentType = "application/msword" and these particular
values appear in a table. One column shows percentages such as "5",
"95", "50", or "<5" There is no "%" character stored in the database
just the number (and the "<" sign if there is one).

Problem is NONE of the "<5" values appear in my report table. Does
this have something to do with "<" being an html character. The field
type is just a size 3 nvarchar. Relevant code below:

strSQL2 = "SELECT * FROM jambue.SUMMARY WHERE POSCODE = '" & id & "'
AND IDCODE1 ='" & dept & "' AND IDCODE2 ='" & unit & "'"
Set rstDBEdit2 = Server.CreateObject("ADODB.Recordset")
rstDBEdit2.Open strSQL2, CONN_STRING, adOpenKeyset, adLockOptimistic,
adCmdText

<font face="Courier New" size="-1"><%=
rstDBEdit2.Fields("H_STAP").Value %> %</font>

Jul 19 '05 #2
Thanks for the reply!

I tried using the HTMLEncode method before making my first post. I had
thought about that having used the method before. However when I use
that on all my fields I still just get a blank. I checked uner VIEW -
HTML SOURCE inside WORD and this is in the spot where my recordset value
should be:

<td style='padding:0in 0in 0in 0in'>
<p class=MsoNormal align=center style='text-align:center'>
<![if !supportEmptyParas]>&nbsp;<![endif]>
<span style='font-size:10.0pt'><o:p></o:p></span></p>
</td>
<5 %>
This is what is looks like for another percentage (100%)

<td style='padding:0in 0in 0in 0in'>
<p class=MsoNormal align=center style='text-align:center'><span
style='font-size:7.5pt;font-family:"Courier New"'>100 %</span><span
style='font-size:10.0pt'><o:p></o:p></span></p>
</td>
So it is getting screwed up somehow.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ensoul Chee | last post by:
I used #include <iostream.h> int m; cout << "Hexadecimal == 0x" << hex << m << endl; to print value of m in hexadecimal mode. But I got the compile error like this couttest.cpp:20 `hex'...
1
by: Christian Schmidbauer | last post by:
Hello! I prepare my XML document like this way: ------------------------------------------------------- PrintWriter writer; Document domDocument; Element domElement; // Root tag
16
by: rik | last post by:
I was flicking through a PHP book (one of the teach in 24 hour ones) and I came across something I had never seen before in PHP. It was a method of printing out without using the print method, it...
3
by: ahaque38 | last post by:
Hello. Using A2K SP3, I am having the following problem with a report using "Sorting and Grouping". I have recently added a grouping in the reports for "Category2<>'CONTRACTS'". I have...
2
by: andrew007 | last post by:
I do xml / xslt transformation using asp.net but I found any value (w/xml format) in xml node html-encoded to &lt and &gt format if it's > or < tag. Since I have sub xml data in a parent xml node...
10
by: Jon Noring | last post by:
Out of curiosity, may a CDATA section appear within an attribute value with datatype CDATA? And if so, how about other attribute value datatypes which accept the XML markup characters? To me,...
12
by: Filipe Sousa | last post by:
Hi! Could someone explain to me why this operation is not what I was expecting? int main() { int x = 2; std::cout << x << " " << x++ << std::endl; return 0; }
3
by: hSiplu | last post by:
hi all, I am creating a web project with php/mysql. one of qeury result is too high. it returs several thousand rows. But I can't show them in one page. So I wanna create more than one pages...
1
by: hifiger2004 | last post by:
Hi Everyone, I have a problem with my classic asp programming. I think I missed something. I encountered logical error an hour ago. And below is one of the lines in my source code wherein I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.