Hmm... I need to find out myself. I don't know what is the answer to that question. I'll do some investigation and get back to you if I got an anything. You should email the people at iPage as they probably could assist you..
Sorry, maybe I didn't explain it very well. I have a page which creates a query from a database. One submit button displays the query in raw XML, the second displays the data using a .XSL and puts it into a table, now the third button needs to either put the data returned into a file that can be opened by Excel or just open Excel and pass those data values into the opened spreadsheet..
Well, excel can read many types of files. Why not place the data into a tab or comma delimited file and just allow excel to import the file?..
Okay, I could be off the mark here but here goes....
I feel that westcoaststyle's problem may not be fully understood. I hope he doesn't mind if I try to clarify it a bit..
I think the problem here is that the data is produced in XML (and styled with XLS). Now, as I understand it, XML, XSLT is client side, not server side. In addition to that XML does nothing, it is purely a data definition mark up language. It doesn't have any predefined tags. This means that there are no means of using XML to write to a file on the client's drive..
Therefore, in a nutshell, the problem is how does westcoaststyle get the data from XML into a file, be it comma delimited or whatever?.
Also, there are some xml parser functions within php, but again I have never used them nor know how useful they are..
Perhaps one of the mods could help here?.
Finally, apologies to westcoaststyle if I have only served to further complicate matters...
I think you are going to run into problems that prohibit you saving to excel on the users computer. the only way to save into excel would be to run server side language and save into excel on the server...
Your question intrigued me a little so I did a bit of research and think that php's XML functions would in fact "cut the mustard" for you <is that just a British saying?..
Anyway, if you are interested in a.
Php solution to your problem then let us know here and I will post a couple of samples...
I do this EXACT thing in coldfusion.... I create my data, save it in a comma delimited file WITH THE EXCEL EXTENSION. This way, excell automaticall opens it, and parses out the delimeters.... thus my web data, in excel format..
Obviously the coding is going to be different for each language, plus I have to create the file, save it to a folder on the server, then create a link to it so the user can download it. Still it works flawlessly...
That sounds great..
I've got to look at Coldfusion at some stage...
Sorry for the late response. I've been working really hard on this thing. Do you guys need a sample of my code or something from me to see what I'm doing? I really need to get this done soon..
Yes and if it is going to the user or server?..
This works from within PHP (this script assumes the use of a MySQL database, although this is obviously not required). This script comes courtesy of someone in another forum (just happens that someone posted a question very similar to yours there)...
Also, found an excellent php class that sounds like it's just what you need:.
Although that is good Torrent, westcoaststyle is going to need an ODBC hook up if he is going to excel. last I checked excel is not on *nix machines..
And php doesn't run very well on IIS...
Admittedly the solution I looked to provide was more of a way to produce xls files, which could then be transferred to where ever they would be needed. Not to actually interface with Excel itself..
Is it not possible to run php on IIS?.
I thought it was..
It does run, but has issues. like ASP on *unix. there are programs (chilliSoft) but is not reliable...
The database is an Oracle 9i database (126.96.36.199)..
I'll attach the files in order to give you a good look at my code and the results..
Form_stylesheet.txt - shows the xsl of the initial form.
Xsql_query.txt - shows the sql query that is being made on the database.
Results_stylesheet.txt - shows the xsl which formats the results of the query.
Form_xsql.htm - shows what the input form looks like.
Query Results.htm - shows what the "HTML" button returns..
I think I have a solution to your problem. I've had the same problem on a project once and I know I found a perfect solution without having to save files and stuff like that..
The problem is that I am at work at the moment but I will post the code as soon as I am back home tonight..
So if your patient for just a few hours I'll send in the solution...
First change your mime type to Excel.
<%@ Language=VBScript %>.
'Change HTML header to specify Excel's MIME content type.
Response.ContentType = "application/vnd.ms-excel".
And then write away..
Just create a table and see what's the result in Excel..
I must say that this method only works if you have Excel.
Installed on the client machine...
Could you elaborate on the script a bit?.
Just to close this thread, I figured out that with xml you just have to put one line in the .xsl document that will automatically open the .xml document in Excel..
Thanks for everyone's help on this one!!!!..