Solved

Print option help needed!

Posted on 2006-06-09
15
242 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dynamic? Dropdown Box 29 70
X-Frame-Options - click-jacking 7 46
trim spaces before first character 6 70
SQL Filter Question 8 69
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now