How to Invoke a PDF and export data from an HTML page?

liunx

Guest
I have a HTML link, which opens a .psp page( A .psp webpage is like a .jsp page). This .psp page brings data back in a HTML table, which is in turn returned from an Oracle database.<br />
<br />
I have seen this happen a lot on the web, but am not sure how to do it..<br />
<br />
What is want to do is, have a view PDF button on the the web report and when they click on that button export all the data that is contained on the webpage into a PDF format in a seperate window. <br />
<br />
I am not even sure, what all softwares do i need, if i need one?<br />
<br />
I have Acrobat Distiller 5.0 and Adobe Acrobat 5.0 on my machine, if i need any of them?<br />
<br />
Also, i want to give them a button that says view in EXCEL, and when they click on this button, it should export all the data into excel.. (The closest i have seen on web is it opens as a CSV(comma seperated value) file)<br />
<br />
Any ideas on how to do it?<br />
<br />
Thank you.<!--content-->simplest option will be to have the document in all of the format which you want to display,such as in .pdf and and xls,and then when a user clicks on a button serve the relative file,<br />
However,as you mentioned,it seems that the datawich is shown in table could be anything(ddependent upon the query and the current available data in the db).Which means you want to create pdf file on the fly.<br />
You can do the above using java(jsp+servlets),I am not sure if it will be possible to create an .xl fiel this way though.<!--content-->I think it might be, google does it with the pdf to html conversions. But the lag would be insane for just makind a website a pdf and trying to convirt it to html each time for users. I would not reccomend it, the strain on the server no matter what server side language would be amazing. Also I think it would be hard to setup, I am not sure of this but it might require soap or something with an xml webservice. It is going to need xml no matter what I believe so that means you would need to have a firm grasp of that and a server side language.<br />
Edit:Woops I misread the post, I thought you were going from pdf the html not from html to pdf. This makes it a little more complicated.<!--content-->So how do i do it? I am not familier with JSP's or the servlets?? Any ideas?<br />
<br />
Should i post this question in the Javascript section..<br />
<br />
Thank you!<!--content-->This will have to be done on a fly.. I cannot have .pdf's and then call them..<!--content-->About the excel, you can just write in an excel document using asp or asp.net, it will work a lot like writing into a single table in a jet data base.<!--content-->I am not familiar with .asp or the .net technology. <br />
What are my other options.<br />
<br />
I have someone telling me to do the following,<br />
write the page you want to generate out as an adobe postsfcript file into a directory that was the input directory to adobe distiller. DIstiller would automatically convert the file to a pdf and write it to distiller output directory. This procedure makes pdf files on the fly..??<br />
<br />
but i am not sure about the above either??<br />
<br />
any ideas?<!--content-->I know you can create pdf files on the fly using java.However<br />
That will be rather complicated for the scpoe of this forum<!--content-->Khalid, do you know of any way to update a jet or foxpro data base using php or jsp? My firned is running php off of iis and I was wondering if he can update a jet data base maybe cakeday here could update an xls without much of a problem. Ill have to ask my friend if he has ever tried to do it, I think he only use mysql and xml though.<!--content-->Yes thats no problem,however I am assuming when you say "jet" databases you mean MS Access in more common words<!--content-->yes access, I am in the habit of calling them jet. The connection sting has me saying jet.<!--content-->Ok so whats it that you wanted to be done using access froma web page(which technology??aps,jsp,php)<!--content-->well if you can update access with php, it makes sence that you would be able to update an xls correct? I know how to do it in asp.net but have you ever seen it done in jsp or php? Because that was one of the original questions by cakeday and he apparently has no knowledge of the ms technologies.<!--content-->its as easy as it is to use MySQL in php,<br />
for both php and Java(jsp,servlets) you will use ODBC bridge to connect to access.<br />
Here is a little example of using php to access an access database.<br />
DSN = guestBookDB<br />
Database name = guestbook<br />
<br />
<?php<br />
$conn = odbc_connect("guestBookDB","","") or die("ODBC Connection failed");<br />
$results = odbc_exec($conn,"SELECT * FROM guest_book_data;");<br />
$rows = odbc_fetch_array($results);<br />
foreach($rows as $key => $value){<br />
echo "Key [$key] => Value[$value]<br/>";<br />
}<br />
?><!--content-->Ok I did some digging on google and found this, thought it might be of some use. This is tutorial on how to export a table from a mysql data base o an excel spread sheet. Thought it might be of use<br />
<!-- m --><a class="postlink" href="http://www.phpfreaks.com/tutorials/114/0.php">http://www.phpfreaks.com/tutorials/114/0.php</a><!-- m --><br />
here is some raw code that the author claims will write excel spread sheets from a mysql table too.<br />
<!-- m --><a class="postlink" href="http://www.stargeek.com/scripts.php?script=2&cat=sql">http://www.stargeek.com/scripts.php?script=2&cat=sql</a><!-- m --><br />
maybe this or the tutorial's scripts can be adapted for this situation?<!--content-->awsome link<br />
<!-- m --><a class="postlink" href="http://www.phpfreaks.com/tutorials/114/0.php">http://www.phpfreaks.com/tutorials/114/0.php</a><!-- m --> <br />
<br />
THis guys is only changing the headers to get the whole thing done..pretty neat<!--content-->heh, I do not know php so I can't really appreciate the full meaning of that. But all I did was put in a google search<br />
'mysql excel php' and in another 'writing excel php'<!--content-->
 
Back
Top