Solved

aspEasyPDF question

Posted on 2009-05-19
7
355 Views
Last Modified: 2012-05-07
Dear Experts

I am using aspEasyPDF to generate a PDF output.  I have session variables, for example pPrice.  I am using the code below which is the syntax to return the records contained within the PDF.  

My session variable is called pPrice and I wondered how to correctly amend the syntax below to use the session variable (pPrice) to replace the entered value 250000?

Thanks for any suggestions

Grant
fp_sQry = "SELECT * FROM dbo.Property  WHERE pPrice >= 250000   ORDER BY pPrice DESC"

Open in new window

0
Comment
Question by:grantballantyne
  • 4
  • 3
7 Comments
 
LVL 12

Expert Comment

by:R_Harrison
Comment Utility
Try the below, I assume pPrice is a numeric value?
fp_sQry = "SELECT * FROM dbo.Property  WHERE pPrice >= " & Session("pPrice") & "   ORDER BY pPrice DESC"

 

Open in new window

0
 

Author Comment

by:grantballantyne
Comment Utility
Thanks for the suggestion.  I have tried this and I get the following error within the PDF

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'ORDER'.
/easi/CMS/pdfreports/propertyresults_adv_pdf.asp , line 116
0
 
LVL 12

Expert Comment

by:R_Harrison
Comment Utility
The below is for non-numeric.    What is the value of Session("pPrice")??
fp_sQry = "SELECT * FROM dbo.Property  WHERE pPrice >= '" & Session("pPrice") & "' ORDER BY pPrice DESC"

  

Open in new window

0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:grantballantyne
Comment Utility
Thanks again R Harrison.

The PDF is generated using the above but the Session value is ignored?
0
 
LVL 12

Accepted Solution

by:
R_Harrison earned 500 total points
Comment Utility
Have you checked that Session("pPrice") has a value?

You could add a line above, such as
Session("pPrice")=25000
and see if it works, if so then the error is with the session value and you will need to post more code for me to troubleshoot it.
0
 

Author Comment

by:grantballantyne
Comment Utility
Thanks R Harrison.

By entering a fixed value for the session it seems to work fine for example <%Session("pMinPrice") = 250000 %>

It appears that the only way to push through a value for the Session is to append it to the URL from the previous page.  However I have a similar problem with the previous page as to how to code this.

Please see code below which is the previous page.

<%
 

' Example that read an html file and renders it

' to PDF.

' This version is to show the Professional feature

' to read html files.	
 

' Clear out the existing HTTP header information

Response.Expires = 0

Response.Buffer = TRUE

Response.Clear

Response.ContentType = "application/pdf"
 

dim PDF
 

set PDF = server.createobject("aspPDF.EasyPDF")
 

PDF.License("EasyPDF.lic")
 

' Set margins for the page

PDF.SetMargins 20,20,20,20
 

'FileName = Server.MapPath("pdf_html_dbtables1.asp")

'PDF.AddHtml( "http:///" & FileName )
 

PDF.AddHtml( "http://dev.easiproperty.net/easi/CMS/pdfreports/propertyresults_adv_pdf.asp" )
 
 

PDF.BinaryWrite
 

set pdf = nothing
 

%>

Open in new window

0
 

Author Comment

by:grantballantyne
Comment Utility
Thanks for all your help with this.

I have used the following:  PDF.AddHtml( "http://dev.easiproperty.net/easi/CMS/pdfreports/propertyresults_adv_pdf.asp?pMinPrice=" & Request.QueryString("pMinPrice")  )

which has worked.  
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now