?
Solved

Print option help needed!

Posted on 2006-06-09
15
Medium Priority
?
248 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
[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
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

801 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