If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Font format issue. (Classic ASP)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-17-07, 18:19
jazzlall jazzlall is offline
Registered User
 
Join Date: Oct 2006
Posts: 6
Font format issue. (Classic ASP)

I returning information from a database that check the database for item that are below a certain level (it's a stock inventory), and then returns the result of that. The function itself works fine, however the text is unformatted and i wish to be able to format the text. As a bit of a newbie when it comes to ASP (my friend did the code for me) I was wondering if anyone could help. The code is as follows:

Dim sQuery
sQuery = "select ItemName from item where CurrentQty < ParLevel"
oRS.Open sQuery, oConnection

do while not oRS.EOF
Response.Write("<div align=""center"">" & oRS("ItemName") & " is below par level</font><div>")
oRS.MoveNext
loop

oRS.Close
Set oRS = Nothing
%>


Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 04-17-07, 18:49
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
How do you want the text formatted?
Also, I notice </font>, with no opening tag... That can't be right!

How are you at creating tables? That's always an option!

I will just quickly slip in that the <font> tag has been deprecated from XHTML (but that's a topic for another day!)
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 04-17-07, 18:58
jazzlall jazzlall is offline
Registered User
 
Join Date: Oct 2006
Posts: 6
I have just noticed that. That's not suppose to be there, that was when I was trying to format it myself. I only want basic formatting, the text to be a bit bolder and bigger. At the moment, it's just at a default value. Here's the code without the </font> tag

Dim sQuery
sQuery = "select ItemName from item where CurrentQty < ParLevel"
oRS.Open sQuery, oConnection

do while not oRS.EOF
Response.Write("<div align=""center"">" & oRS("ItemName") & " is below par level<div>")
oRS.MoveNext
loop

oRS.Close
Set oRS = Nothing
%>


Thanks,
Reply With Quote
  #4 (permalink)  
Old 04-17-07, 19:06
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Ok, a couple of things I would change for starters is the use of double-double quotes.
Response.Write("<div align=""center"">" & ...
Should become:
Response.Write("<div align='center'>" & ...

IF you simply want slightly bigger bolder text, then the header tags <h1></h1>, <h2></h2> should do what you want. The best resource for HTML (imo) is www.w3schools.com

Oh, and to tidy up your code, so that you're not repeating the same div's/styles/fonts for every record in your recordset, put the styles outside fo the loop
Code:
Response.Write("<div align='center'><h1>")
do while not oRS.EOF
Response.Write(oRS("ItemName") & " is below par level")
oRS.MoveNext
loop
Response.Write("</h1></div>")
Please ask if you don't understand anything I've written!
__________________
George
Twitter | Blog
Reply With Quote
  #5 (permalink)  
Old 04-17-07, 19:13
jazzlall jazzlall is offline
Registered User
 
Join Date: Oct 2006
Posts: 6
Thanks! You've been a great help.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On