Solved

Print option help needed!

Posted on 2006-06-09
15
244 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF Embed pdfobject.js local path problem regular ASP 2 144
Select2 jquery help 9 90
Query not working correctly? (or how i want it to... 6 50
alert(innerHTML); 8 18
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

809 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