?
Solved

response.write and aspEasypdf

Posted on 2008-02-01
3
Medium Priority
?
218 Views
Last Modified: 2010-04-07
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

0
Comment
Question by:grantballantyne
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 total points
ID: 20802384
grantballantyne,

Does the image at the top of the table get placed in the PDF?  I am not familiar with tthat tool but I believe the problem is just not using the img tag.  Try ...

            response.write "<td><img src=""../../propertyphotos/" & propertylist("pPhoteFile") & """ alt="""" /></td>"

The path for the src may not be right and you may need to provide other attributes in the img tag.

Let me know if you have any questions or need more information.

b0lsc0tt
0
 

Author Comment

by:grantballantyne
ID: 20804698
Thanks b0lsc0tt

thats worked a treat
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20804823
Great!  Your welcome!  I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month3 days, 9 hours left to enroll

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question