Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

aspEasyPDF question

Posted on 2009-05-19
7
370 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
ID: 24426106
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
ID: 24426211
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
ID: 24426249
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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:grantballantyne
ID: 24426700
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
ID: 24426869
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
ID: 24432810
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
ID: 24432917
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Compare site how does it work 4 80
Recieving large files from China 4 145
html Uncheck Checkbox 2 25
PHP Curl to output a url 7 47
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

840 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