Solved

Print option help needed!

Posted on 2006-06-09
15
245 Views
Last Modified: 2008-02-26
We have a webpage where users click on different options. Based on their options, data is pulled from an SQL dbase and displayed on the next page. We want to give the user the option to print as HTML or print as PDF. Sounds pretty simple. Problem is this:

The server that hosts the sql dbase won't allow us to upload ABCpdf or any other software to give the print as PDF option. We have our own server that we don't have much on but isn't set up for SQL. I have installed the aBCpdf on this machine and they have told me that I need to save the HTML output from the query to a page on the server and then it will convert to pdf through ABCpdf. I have no idea how to do that.

Can someone help me?
0
Comment
Question by:katlees
  • 8
  • 5
15 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871222
You can get the html from the other server with code like this:

Function GetHTML(strURL)
      Dim objXMLHTTP, strReturn
      Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
      objXMLHTTP.Open "GET", strURL, False
      objXMLHTTP.Send
      strReturn = objXMLHTTP.responseText
      Set objXMLHTTP = Nothing
      GetHTML = strReturn
End Function

However, I am not sure how that will help you as you would need to do something with the .pdf file when you are done?

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871237
Sorry, I forgot to provide an example of how to use the code above:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<%
Function GetHTML(strURL)
     Dim objXMLHTTP, strReturn
     Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
     objXMLHTTP.Open "GET", strURL, False
     objXMLHTTP.Send
     strReturn = objXMLHTTP.responseText
     Set objXMLHTTP = Nothing
     GetHTML = strReturn
End Function
%>

</head>
<body>
<%
=GetHTML("http://www.FairfieldConsulting.com/index.asp")
%>
</body>
</html>

FtB
0
 

Author Comment

by:katlees
ID: 16871260
FtB,

So on the page that shows the results initially, do I have a print icon that takes them to the page that has this code?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871302
I think that we are getting ahead of ourselves here. The bigger issue is how to deal with having the two servers.

Does the server with ABCpdf run web pages? If so, I suppose that you could redirect the user to the second server for the output:

1) the request to print is made from your main server
2) the secondary sever uses the function above to get the html output
3) it converts to .pdf
4) your user downloads from there

this all sounds somewhat clunky....

FtB
0
 

Author Comment

by:katlees
ID: 16871324
The output pulls from the sql server, can I have that page located on a different server than the sql database is on?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871371
I am a little confused. Is the sql server the same server as your primary web server?

FtB
0
 

Author Comment

by:katlees
ID: 16871578
Ok, server A has the entire website. It is a 3rd party server that allows SQL databases.

Server B is our own server and I have ABCpdf installed on it. I need to take the results from Server A and print to a pdf using Server B. Is there  a way to do this?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871901
Does Server B serve web pages?

FtB
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16871903
As an aside, if your sql database is sql server, there is a way to output .pdf directly.

FtB
0
 

Author Comment

by:katlees
ID: 16871924
Yes, server B has web pages. HOw do we output .pdf directly. That would be a lifesafter!
0
 
LVL 46

Accepted Solution

by:
fritz_the_blank earned 500 total points
ID: 16871967
0
 

Author Comment

by:katlees
ID: 16871990
Wow. this looks complicated Is it?
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 16872003
I haven't tried it, so I can't say for certain.

FtB
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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