chrometweaks.org

Setting up web design and iPage web hosting help?

Click Here To View All Answers...


My first question is Setting up web design and iPage web hosting help? Many thanks for any comment. My other question... What do I need to do in order to send data created by a page to Excel?.

Thanks!..

Comments (19)

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

Comment #1

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

Better explanation?..

Comment #2

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?..

Comment #3

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?.

I think that he needs to take the data and feed it into php or another server side language, that will then allow him to write it to a file. I don't know XML that well but I think you can pass the information quite easily into javascript and then from there to php (I know you can pass data between javascript and php, but I haven't done this myself)..

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

Comment #4

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

Comment #5

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.

Possible.

Php solution to your problem then let us know here and I will post a couple of samples...

Comment #6

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

Comment #7

That sounds great..

I've got to look at Coldfusion at some stage...

Comment #8

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

Thanks!..

Comment #9

Yes and if it is going to the user or server?..

Comment #10

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)...

Comment #11

Also, found an excellent php class that sounds like it's just what you need:.

Http://phpclasses.upperdesign.com/br...ml/package/408..

Comment #12

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

Comment #13

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

Thanks..

Comment #14

It does run, but has issues. like ASP on *unix. there are programs (chilliSoft) but is not reliable...

Comment #15

The database is an Oracle 9i database (9.0.1.2)..

I'll attach the files in order to give you a good look at my code and the results..

File Key:.

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

Comment #16

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

Comment #17

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

Comment #18

Could you elaborate on the script a bit?.

Thanks!..

Comment #19

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!!!!..

Comment #20


This question was taken from a support group/message board and re-posted here so others can learn from it.