Formatting output from database

This is a discussion on "Formatting output from database" within the Classic ASP section. This forum, and the thread "Formatting output from database are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 11th, 2005, 01:04
New Member
Join Date: Dec 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Formatting output from database

I cant seem to populate the database so that it shows the formatting such as paragraphs in the text. This is my source code.
What i want is that the output in title, introduction,.. etc. to have paragraphs, but instead with the codes above, the paragraphs disappears.
Can someone help me out? Thanks
Code: Select all
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% option explicit %>
<%Response.Buffer = True%>
<!--#include file="../../includes/AccessChecking.asp" -->
<%
Dim rsStatus, conn, sqlqueryStatus, querystringReportID
Dim strDateReport, strTitle, strIntroduction, strExperimental, strResults, strConclusion, strPreparedby ,strCheckedBy, strDateCheck, strFileName
querystringReportID = Request.QueryString
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open Server.MapPath("..\..\sources\db\engineerreport.mdb")
set rsStatus = Server.CreateObject("ADODB.recordset")
sqlqueryStatus = ""
sqlqueryStatus = sqlqueryStatus & "SELECT [ReportID], [Date of Report], [Title], [Introduction], [Experimental], [Results], [Conclusion], " 
sqlqueryStatus = sqlqueryStatus & " [Prepared By], [Checked By], [Date Checked], [Uploaded File] FROM recordtable "
sqlqueryStatus = sqlqueryStatus & "WHERE [ReportID] = '" & querystringReportID & "'"
rsStatus.Open sqlqueryStatus, conn
strDateReport = rsStatus("Date of Report")
strTitle = rsStatus("Title")
strIntroduction = rsStatus("Introduction")
strExperimental = rsStatus("Experimental")
strResults = rsStatus("Results")
strConclusion = rsStatus("Conclusion")
strPreparedby = rsStatus("Prepared by")	
strCheckedBy = rsStatus("Checked by")
strDateCheck = rsStatus("Date Checked")
strFileName = rsStatus("Uploaded File")
rsStatus.close 
conn.close
set rsStatus = nothing
set conn = nothing
%>
<html>
<head>
<title>Engineer Report</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--#include file="../../includes/general.asp" -->
<link href="../../styles/vrformstyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- MSTableType="layout" -->
<tr> 
<td width="14%" height="43"><img name="logo" src="/MCDOnlineSystem/sources/pics/logo1.gif" width="110" height="30" alt="Shin Etsu"></td>
<td width="66%" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td><div align="center"> 
<h3><strong>MONTHLY REPORT - 
<%= UCase(MonthName(DatePart("m",strDateReport))) & " " & Year(strDateReport) %> </strong></h3>
</div></td>
</tr>
<tr> 
<td height="14"><div align="center">MATERIAL CHARACTERIZATION 
DEPARTMENT</div></td>
</tr>
</table></td>
<td width="20%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr> 
<td><div align="right"><font size="-1">Format 
No: <%=engineerFormatNo%></font></div></td>
</tr>
<tr> 
<td><div align="right"><font size="-1">Effect. 
Date: <%=engineerEffectDate%></font></div></td>
</tr>
</table></td>
</tr>
<tr> 
<td colspan="4">&nbsp;</td>
</tr>
<tr> 
<td colspan="2">DATE OF REPORT: <font color="#0000FF"><%=UCase(strDateReport)%></font></td>
<td colspan="2"><div align="right">REPORT NO: <font color="#0000FF"><%=querystringReportID%></font></div></td>
</tr>
<tr> 
<td height="282" colspan="4">
<table width="787" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" height="129" id="table2">
<!-- MSTableType="layout" -->
<tr>
<td width="487" rowspan="3" valign="top">
<table border="0" width="487" id="table3" height="121">
<tr>
<td width="473" height="20"><b>
<font size="4">TITLE:</font></b></td>
<td width="4" rowspan="3">
&nbsp;</td>
</tr>
<tr>
<td width="473"><%=strTitle%></td>
</tr>
<tr>
<td width="473">&nbsp;</td>
</tr>
</table>
</td>
<td valign="top">&nbsp;Prepared 
by:</td>
<td height="34" valign="top">&nbsp;Checked 
by:</td>
</tr>
<tr>
<td>&nbsp;<%=UCase(strPreparedby) %></td>
<td height="46">&nbsp;<%= UCase(strCheckedBy) %></td>
</tr>
<tr>
<td width="146">&nbsp;<%=(strDateReport)%></td>
<td width="144" height="45">&nbsp;<%=strDateCheck%></td>
</tr>
</table>
<br />
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" id="table4">
<!-- MSTableType="layout" -->
<tr> 
<td><strong>Introduction :</strong><p><%=strIntroduction%></td>
</tr>
</table>
<br />
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" id="table6">
<tr>
<td><strong>Experimental :</strong><p><%=strExperimental%></td>
</tr>
</table>
<br />
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" id="table7">
<tr>
<td><strong>Results and discussion :</strong><p><%=strResults%></p>
</td>
</tr>
</table>
<br />
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#000000" id="table8">
<tr> 
<td><strong>Conclusion :</strong><p>
<%=strConclusion%>
</p></td>
</tr>
</table>
<br />
<p><h5><strong>Attachment: 
<%
If not strFileName = "" Then
Response.Write("<a target='_blank' href='..\..\DepartmentReport\EngineerReport2\UploadFiles\" & strFileName &"'>" & strFileName & "</a>")
Else
Response.Write("NONE")
End If
%> 
</strong></h5></p>
<table width="100%" border="2" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<tr bordercolor="#FFFFFF"> 
<%
if strCheckedby="" or  ISNULL(strCheckedby) and Request.Cookies("USER")("HOD") then
%>
<td width="50%"><h3>Head of Department Validation Status: </h3></td>
<%Response.Write("<td width='50%'><h3>PENDING</h3></td>")%>
</tr>
<tr bordercolor="#FFFFFF"> 
<td><div align="right">Validate this Engineer Report?</div></td>
<td><form action="validateFormData/erapproval.asp" method="post" name="FrValidate" id="FrValidate">
&nbsp;<input name="btnSubmit2" type="submit" id="btnSubmit2" value="Yes">&nbsp;
<input name="hdqueryStringReportID" type="hidden" id="hdqueryStringReportID" value="<%=queryStringReportID%>">
<input name="hdValidationStatus" type="hidden" id="hdValidationStatus" value="HOD">
</form></td>
</tr>
<% 
else
end if
%>
</table>
</td>
</tr>
</table>
</body>
</html>
Reply With Quote

  #2 (permalink)  
Old Dec 11th, 2005, 19:04
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: Formatting output from database

I think you are asking a little too much if you want this whole page converted to using no tables.... or did I mis-understand your request?
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #3 (permalink)  
Old Dec 11th, 2005, 22:36
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: Formatting output from database

i too am a little confused here...
Reply With Quote
  #4 (permalink)  
Old Dec 11th, 2005, 23:43
New Member
Join Date: Dec 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Formatting output from database

in the input area, when i type
-blah
-blah
-blah

it is save the similar way in the database with paragraphs. But when i call it from database and display it using the
<%=strName %> the text becomes
-blah -blah -blah

the paragraphs disappears. So my question is how do i get the paragraps back so that it looks like the way u enter it.

thanks
Reply With Quote
Reply

Tags
formatting, output, database

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Php output in to CSS dhossai Web Page Design 1 Oct 30th, 2007 18:38
Distinct output using ASP/SQL bullrider Classic ASP 0 May 29th, 2007 16:55
displaying the output madhuri.t Classic ASP 3 Jul 12th, 2006 15:49
output IE vs. FF jojo Web Page Design 5 Dec 29th, 2005 13:35
no output at all -- can't see why in code (???) jswebdev PHP Forum 8 Oct 16th, 2005 05:07


All times are GMT. The time now is 21:00.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43