
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"> </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">
</td>
</tr>
<tr>
<td width="473"><%=strTitle%></td>
</tr>
<tr>
<td width="473"> </td>
</tr>
</table>
</td>
<td valign="top"> Prepared
by:</td>
<td height="34" valign="top"> Checked
by:</td>
</tr>
<tr>
<td> <%=UCase(strPreparedby) %></td>
<td height="46"> <%= UCase(strCheckedBy) %></td>
</tr>
<tr>
<td width="146"> <%=(strDateReport)%></td>
<td width="144" height="45"> <%=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">
<input name="btnSubmit2" type="submit" id="btnSubmit2" value="Yes">
<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>
|