Solved

Print option help needed!

Posted on 2006-06-09
15
246 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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