Jump to content

buckibooster

Recommended Posts

I've created a php file that gathers data from my SQL tables and creates a multi-sheet Excel workbook file in XML. I started this process by creating the file as I wanted it to appear using MS Excel 2010 and saved it as a XML file. I then wrote my PHP code to dynamically create the MS Excel XML file. In internet Explorer 11, when this is done, the file opens as a MS Excel file. My problem is that it doesn't work in Firefox (Version 31.0). In Firefox, it prints out on the screen as an unformatted XML file with the following message above the screen - "This XML file does not appear to have any style information associated with it. The document tree is shown below." I think the problem is in my header. This is the way the opening of my PHP file appears now:

<?phpheader("Content-type: text/xml");echo "<?xml version="1.0" encoding="UTF-8"?><?mso-application progid="Excel.Sheet"?>";?><Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"><-- More code follows -->

Any help you can offer will be welcome!

 

 

Link to comment
Share on other sites

... That is my answer.... Posting this here want to much of a chance to reply. I know these forum... Matter fact, I'm the one that conteibute the most in the XML section. I'm telling you that you that you will get a hm higher percent chance of an reply posting this in the php section, even the html, or web service section. But do what you want with that attitude.WHOLE CRUD GUYS LOOK AT THESE TYPOSREDO:... That is my answer.... Posting this here won't give you much of a chance to reply. I know these forum... Matter fact, I'm the one that contribute the most in the XML section. I'm telling you that you will get a higher percent chance of an reply posting this in the php section, even the html, or web service section.

Edited by L8V2L
Link to comment
Share on other sites

Posting a question in a forum is my method of last resort. Before I post, I will pour over reference materials for days trying to find the answer to my question. If I don't have the reference I need, I will go out and find one. Armed with this, I will spend days of trial and error in trying to make my code do just what I want it to. If that doesn't work, I'll go out onto the internet and do some research. This may lead me to a forum question that is similar to mine. On some occasions, these give me an idea that I spend days working with to try to make it fit my needs. Asking a question on a forum is done only after days of wasted research and trial and error has not led to an answer. In other words, I am desperate and need to find an answer.

 

Among the many important things I've learned in my life is 1) if you don't have anything good to say then don't say anything at all and 2) if you're not part of the solution, you're part of the problem. So when I place a question on a forum:

  1. If you feel the need to make a joke about part of the question, you're not being part of the solution;
  2. If you suggest that another programming language might hold the answer, you're not being helpful; and
  3. If you suggest that I post my question somewhere else, you're being a part of the problem.

Over the years, I have probably asked a dozen questions on forums. Each time, I was desperately looking for a solution to my problem. What I got in every case was not part of the solution but part of the problem. This is the reason for the attitude. If you can't handle it, move onto another question and let someone who really wants to help and has a solution to my problem answer my question.

  • Like 1
Link to comment
Share on other sites

Posting a question in a forum is my method of last resort. Before I post, I will pour over reference materials for days trying to find the answer to my question. If I don't have the reference I need, I will go out and find one. Armed with this, I will spend days of trial and error in trying to make my code do just what I want it to. If that doesn't work, I'll go out onto the internet and do some research. This may lead me to a forum question that is similar to mine. On some occasions, these give me an idea that I spend days working with to try to make it fit my needs. Asking a question on a forum is done only after days of wasted research and trial and error has not led to an answer. In other words, I am desperate and need to find an answer. Among the many important things I've learned in my life is 1) if you don't have anything good to say then don't say anything at all and 2) if you're not part of the solution, you're part of the problem. So when I place a question on a forum:

  • [*]If you feel the need to make a joke about part of the question, you're not being part of the solution;[*]If you suggest that another programming language might hold the answer, you're not being helpful; and[*]If you suggest that I post my question somewhere else, you're being a part of the problem.

Over the years, I have probably asked a dozen questions on forums. Each time, I was desperately looking for a solution to my problem. What I got in every case was not part of the solution but part of the problem. This is the reason for the attitude. If you can't handle it, move onto another question and let someone who really wants to help and has a solution to my problem answer my question.

READ!!!: this is the XML section! This thread does not have a lot of moderator on it. There is a php section. Your problem sound like php. So go post this on php. I'm not telling you to go to another site. I'm helping! I'm telling you that your chances are greater copying and pasting this in the php section. Edited by L8V2L
Link to comment
Share on other sites

There is nothing in your code telling Firefox to open the XML file with Excel. Your content-type is text/xml, which is a generic XML file. IE might have additional tie-ins with Excel where, for example, IE will look for information in the XML file to try and figure out if it should open it in another application. Firefox just treats it like a regular XML file. You can try setting the content type to "application/vnd.ms-excel", or try changing the extension to one of the ones listed here:http://technet.microsoft.com/en-us/library/cc179191(v=office.15).aspx

Link to comment
Share on other sites

There is nothing in your code telling Firefox to open the XML file with Excel. Your content-type is text/xml, which is a generic XML file. IE might have additional tie-ins with Excel where, for example, IE will look for information in the XML file to try and figure out if it should open it in another application. Firefox just treats it like a regular XML file. You can try setting the content type to "application/vnd.ms-excel", or try changing the extension to one of the ones listed here:http://technet.microsoft.com/en-us/library/cc179191(v=office.15).aspx

JSG --you freaken block or froze my thread again you...-- aim what I'm telling this guy wrong?!?!?!? Wouldn't this had been a better fit to post in the php!?!?!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...