Link to home
Start Free TrialLog in
Avatar of grantballantyne
grantballantyneFlag for United Kingdom of Great Britain and Northern Ireland

asked on

response.write and aspEasypdf

Dear Experts

I am using dreamweaver, asp & sql 2005.  I am also using aspEasypdf to generate a report from database data to pdf.

I am able to get the data output to the PDF fine, however one of the columns stores a path to and image file and I would like to display each image next to the appropriate row of data.  

Please see my full code below in the snippet which works fine for the data output to pdf - however the line response.write "<td>" & propertylist("pPhoteFile") & "</td>" actually prints the image filename instead of pulling the image and placing it into the PDF.

Thanks in advance for any help

Grant
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/camsmith.asp" -->
<%
Dim propertylist__MMColParam
propertylist__MMColParam = "Sold"
If (Request("MM_EmptyValue") <> "") Then 
  propertylist__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim propertylist
Dim propertylist_cmd
Dim propertylist_numRows
 
Set propertylist_cmd = Server.CreateObject ("ADODB.Command")
propertylist_cmd.ActiveConnection = MM_camsmith_STRING
propertylist_cmd.CommandText = "SELECT * FROM dbo.Property LEFT OUTER JOIN  dbo.countnotesofinterest on dbo.property.pRef = dbo.countnotesofinterest.nPref LEFT OUTER JOIN dbo.countsurveys on dbo.property.pRef = dbo.countsurveys.sPref WHERE pStage <> ? and pStage <> 'Pre Sale' and pStage <> 'Withdrawn' and pPropertyType = 'ResSale' ORDER BY pPrice DESC" 
propertylist_cmd.Prepared = true
propertylist_cmd.Parameters.Append propertylist_cmd.CreateParameter("param1", 200, 1, 15, propertylist__MMColParam) ' adVarChar
 
Set propertylist = propertylist_cmd.Execute
propertylist_numRows = 0
%>
<html>
 
<head>
<title>Easi Property - Current Residential For Sale</title>
</head>
 
<body bgcolor="#FFFFFF">
 
<p><font size="6" color="#057ca6"><b><u>Current Residential For Sale</u></b></font></p>
 
 
<table border="1" width="100%">
  <tr>
    <td colspan="3"><img src="../../propertyphotos/<%=(propertylist.Fields.Item("pPhoteFile").Value)%>" alt="property image" width="122" height="81" hspace="5" vspace="5" /><font color="#FFFFFF">Tables support</font></td>
  </tr>
</table>
 
 
<%
fp_sQry = "SELECT * FROM dbo.Property LEFT OUTER JOIN  dbo.countnotesofinterest on dbo.property.pRef = dbo.countnotesofinterest.nPref LEFT OUTER JOIN dbo.countsurveys on dbo.property.pRef = dbo.countsurveys.sPref WHERE pStage <> 'Sold' and pStage <> 'Pre Sale' and pStage <> 'Withdrawn' and pPropertyType = 'ResSale' ORDER BY pPrice DESC"
set propertylist  = CreateObject("ADODB.Recordset")
strConnString = MM_camsmith_STRING
 
propertylist.Open fp_sQry, strConnString
if Err.Description <> "" Then
    Response.Write "<B>Error: " + Err.Description + "</B>"
    Response.Write "<br><B>SQL: " + fp_sQry + "</B>"
Else
 
 
 
 
 
	response.write "<table border=""1"">"
	
		response.write "<tr>"
		response.write "<td>" & "Property Photo" & "</td>"
		response.write "<td>" & "Property Address" & "</td>"
		response.write "<td>" & "Price" & "</td>"
		response.write "<td>" & "Status" & "</td>"
	
 
 
Do Until propertylist.EOF
		response.write "<tr>"
		response.write "<td>" & propertylist("pPhoteFile") & "</td>"
		response.write "<td>" & propertylist("pAddress1") & ", " & propertylist("pAddress2") & propertylist("pTown") & "</td>"
		response.write "<td>" & propertylist("pPriceType") & "£" & propertylist("pPrice") & "</td>"
		response.write "<td>" & propertylist("pStage") & "</td>"
		response.write "</tr>"
		propertylist.MoveNext
	Loop
	response.write "</table>"
End If
propertylist.Close
set propertylist = nothing
%>
 
 
 
 
</body>
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grantballantyne

ASKER

Thanks b0lsc0tt

thats worked a treat
Great!  Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol