Solved

aspEasyPDF question

Posted on 2009-05-19
7
375 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
[X]
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
  • 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
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…

696 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